承接 mrshanebarron/editor 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mrshanebarron/editor

最新稳定版本:v1.0.1

Composer 安装命令:

composer require mrshanebarron/editor

包简介

Rich text editor component for Laravel - supports Livewire and Vue

README 文档

README

A rich text editor component for Laravel applications. WYSIWYG editing with toolbar for formatting. Works with Livewire and Vue 3.

Installation

composer require mrshanebarron/editor

Livewire Usage

Basic Usage

<livewire:sb-editor wire:model="content" />

With Placeholder

<livewire:sb-editor
    wire:model="article"
    placeholder="Write your article..."
/>

Livewire Props

Prop Type Default Description
wire:model string - HTML content
placeholder string 'Write something...' Placeholder text
editor-class string '' Additional CSS classes

Vue 3 Usage

Setup

import { SbEditor } from './vendor/sb-editor';
app.component('SbEditor', SbEditor);

Basic Usage

<template>
  <SbEditor v-model="content" />
</template>

<script setup>
import { ref } from 'vue';
const content = ref('');
</script>

With Options

<template>
  <SbEditor
    v-model="content"
    placeholder="Start writing your blog post..."
    editor-class="min-h-[400px]"
  />
</template>

Form Example

<template>
  <form @submit.prevent="save" class="space-y-4">
    <div>
      <label class="block text-sm font-medium mb-2">Title</label>
      <input v-model="form.title" class="w-full px-3 py-2 border rounded-lg" />
    </div>

    <div>
      <label class="block text-sm font-medium mb-2">Content</label>
      <SbEditor v-model="form.content" />
    </div>

    <button type="submit" class="px-4 py-2 bg-blue-600 text-white rounded-lg">
      Publish
    </button>
  </form>
</template>

<script setup>
import { reactive } from 'vue';

const form = reactive({
  title: '',
  content: ''
});

const save = () => {
  console.log('Saving:', form);
};
</script>

Vue Props

Prop Type Default Description
modelValue String '' HTML content
placeholder String 'Write something...' Placeholder text
editorClass String '' Additional editor classes

Events

Event Payload Description
update:modelValue string Content changed

Toolbar Features

Button Action
B Bold text
I Italic text
U Underline text
List Bullet list
123 Numbered list

Features

  • WYSIWYG Editing: See formatting as you type
  • Toolbar: Quick formatting buttons
  • Paste Handling: Strips formatting from pasted text
  • Placeholder: Shown when empty
  • Prose Styling: Clean typography

Styling

Uses Tailwind CSS:

  • Gray toolbar background
  • Border around editor
  • Prose typography styling
  • Focus ring on editor

Requirements

  • PHP 8.1+
  • Laravel 10, 11, or 12
  • Tailwind CSS 3.x

License

MIT License

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-16