zxxi7i/editor

surface editor富文本组件

v1.0.5 2024-05-24 23:37 UTC

This package is auto-updated.

Last update: 2024-10-25 03:04:51 UTC


README

surface 的富文本组件

安装

# 运行环境要求 PHP8+
composer require zxxi7i/editor

使用


use surface\components\Form;
use surface\editor\Editor;
use surface\Surface;

$surface = new Surface();

// 注册组件
Editor::register($surface);

$form = (new Form())
    ->props(
        [
            "columns" => [
                (new Editor())
                    ->name('editor')->label("详情")
                    ->value("<h1>Hello</h1>")
                    ->props(
                        [
                            "editorStyle" => [
                                "minHeight" => "150px",
                            ]
                        ]
                    )
                ,
            ],
        ]
    );

echo $form->view($surface);

iDsjta.png

Attributes

属性名说明类型默认值
editorConfig编辑器配置Array[]
toolbarConfig工具栏配置Array[]
editorStyle编辑器样式Array[]
mode富文本模式stringdefault

@see https://www.wangeditor.com/v5/