# dcat-wang-editor **Repository Path**: dcat-phper/dcat-wang-editor ## Basic Information - **Project Name**: dcat-wang-editor - **Description**: Dcat-admin Form Extend WangEditor - **Primary Language**: PHP - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 3 - **Created**: 2021-09-26 - **Last Updated**: 2023-06-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Dcat Admin Form WangEditor扩展 拖拽上传,复制上传 ## 部分代码参考[dcat-markdown](https://gitee.com/dcat-phper/dcat-markdown) ## [WangEditor文档](https://www.wangeditor.com/doc/) ## 示例 --- ![](example/img.png) --- # 安装和使用 ## composer 安装 --- ```shell composer require death_satan/dcat-wang-editor -vvv ``` --- ## 使用 ## 在form中使用 --- ```php /** * @var $form \Dcat\Admin\Form */ $form->wangEditor('column') ``` --- # 所有的配置参数请参考官方参数,本扩展只做了极小的兼容性处理 ## 建议使用phpstorm编辑器,并且安装扩展后运行 `php artisan admin:ide` 命令生成ide提示文件 ## 已开放的接口
方法名 参数 说明 示例
colors array $colors 配置颜色(文字颜色、背景色) 官方文档
height int $height 设置编辑器容器高度 参考WangEditor文档
emotions array $emotions 配置表情图标 emotions示例
Menu array $data 定义显示哪些菜单和菜单的顺序 官方文档地址(json换成数组传入即可)
ExcludeMenus array $data 剔除少数菜单 官方文档地址(json换成数组传入即可)
zIndex int $zIndex 配置 z-index 参考WangEditor文档
focus bool $focus=false 自动 focus 官方文档
showFullScreen bool $show=false 设置全屏功能 参考WangEditor文档
showMenuTooltips bool $show=false 设置菜单栏提示 参考WangEditor文档
menuTooltipPosition string $position = 'down' 设置菜单栏提示为[下标:up,下标:down] 参考WangEditor开发文档
pasteFilterStyle bool $state = false 关闭粘贴样式的过滤 同上
pasteIgnoreImg bool $ignore=true 忽略粘贴内容中的图片 同上
disk string $disk = 'local' 设置文件驱动 config/filesystems.php里面设置的disk
ImgDirectory string $path 设置图片上传路径 ...
VideoDirectory string $path 设置视频上传路径 ...
setCss string $css 设置highlight的样式css名 示例
lang string $lang='en' 设置语言 目前官方默认可选的只有 zh-CN en