企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 文档编辑 > 图片示例: ![](https://img.kancloud.cn/ff/c7/ffc7bded8da9cf1effa5799debf8f3f0_1920x903.png) > 配置项 | key | 类型 | 是否必须 | 说明 | | --- | --- | --- | --- | | type | string | 是 | 固定值:`markdown` | | 通用配置... | | mode | string | 否 | 模式,可选值:editormd(默认) | | modeConfig | array | 否 | 模式的配置 | | readonly | bool | 否 | 只读,默认false | > 配置项 modeConfig | key | 类型 | 是否必须 | 说明 | | --- | --- | --- | --- | | editormd | object | 否 | 模式editormd的配置 | | editormd.height | int | 否 | 高度,默认:250 | | editormd.watch | bool | 否 | 实时预览开启,默认:false | | editormd.placeholder | string | 否 | 占位符,默认:此处开始编写... | | editormd.imageFormats | array | 否 | 图片上传允许格式,书写格式:["jpg","png"]。默认为文件配置`[file.upload_img_ext]`的值。该值不能超过配置值的范围。 | | editormd.toolbar | array | 否 | 工具栏 | > 配置项 mode_config.editormd.toolbar 默认值: ``` [ "undo", "redo", "|", "bold", "del", "italic", "quote", "|" ,"h1", "h2", "h3", "h4", "|","list-ul", "list-ol", "hr", "|" ,"align-left","align-center","align-right","align-justify", "|" ,"table", "datetime", "html-entities", "pagebreak", "code", "code-block","|" ,"link", "reference-link", "image", "video", "|" ,"watch", "preview", "clear","search","|","help" ] ``` 说明: | code | 描述 | | --- | --- | | `|` | 分隔符 | | undo | 撤销 | | redo | 重做 | | bold | 粗体 | | del | 删除线 | | italic | 斜体 | | quote | 引用 | | h1 | 标题1 | | h2 | 标题2 | | h3 | 标题3 | | h4 | 标题4 | | list-ul | 无序列表 | | list-ol | 有序列表 | | hr | 横线 | | align-left | 左对齐 | | align-center | 居中对齐 | | align-right | 右对齐 | | align-justify | 两端对齐 | | table | 添加表格 | | datetime | 时间日期 | | html-entities | HTML实体字符| | pagebreak | 插入分页符 | | code | 行内代码 | | code-block | 代码块 | | link | 链接 | | reference-link | 引用链接 | | image | 添加图片 | | video | 插入视频 | | watch | 实时预览 | | preview | 全窗口预览 | | clear | 清空 | | search | 搜索 | | help | 使用帮助 | > 字段值 返回Markdown内容。 > 代码示例: ~~~ $builder=YF('general_example')->tab([ 'base'=>'基础']) ->field(function($tab){ $field=[ 'markdown_test'=>[ 'title'=>'文档编辑', 'type'=>'markdown', // 以下示例参数非必须 "mode"=>"editormd", "modeConfig"=>[ "editormd"=>[ "height"=>250, "watch"=>false, "placeholder"=>"此处开始编写...", "image_formats"=>["jpg","png"], "toolbar"=>["undo", "redo", "|", "bold", "del", "italic", "quote", ...] ] ], ], ]; return $field; }) ~~~