sharemant / laravel-admin-ext-editormd
EditorMd(V.1.5.0) for laravel-admin.
v1.1
2020-07-18 02:42 UTC
Requires
- php: >=7.0.0
- encore/laravel-admin: ~1.6
Requires (Dev)
- phpunit/phpunit: ~6.0
This package is auto-updated.
Last update: 2024-09-29 04:43:32 UTC
README
laravel-admin 的 EditorMD 扩展
这是一个 laravel-admin 扩展,它将 EditorMD 集成到 laravel-admin 表单中。为了适应 laravel-admin,我在 editormd 资产中做了一些小的改动。如果您在使用此扩展时遇到任何困难,请随时联系我。
截图
安装
composer require sharemant/laravel-admin-ext-editormd php artisan vendor:publish --tag=laravel-admin-ext-editormd
配置
在 config/admin.php 文件的 extensions 部分,添加属于此扩展的一些配置。
示例
<?php // file: {Your_project}/config/admin.php return [ 'extensions' => [ 'editormd' => [ // Set to false if you want to disable this extension 'enable' => true, // Set to true if you want to take advantage the screen length for your editormd instance. 'wideMode' => false, // Set to true when the instance included in larave-admin tab component. 'dynamicMode' => false, // Editor configuration write in PHP array grammar 'config' => [ 'path' => '/vendor/laravel-admin-ext/editormd/editormd-1.5.0/lib/', 'width' => '100%', 'height' => 600, ], // Editor configuration write in Javascript object grammar 'configJS' => '{onload: function() { alert("Hello!");}}' ] ] ];
注意
config(PHP数组语法)和 configJS(JavaScript对象语法)选项将被合并到一个新的JavaScript对象中。
您可以使用您喜欢的语法来设置配置。
如果您编写了一个对应于静态值的配置项,最佳实践是使用PHP数组语法。
相反,当涉及到编辑器的监听函数时,您只剩下使用JS对象语法的选项。
默认配置列表
如果您想启用更多 EditorMd 的功能,可以将以下配置添加到您的配置文件中。
编辑器的配置可以在 EditorMD 文档 中找到。
用法
在表单中使用它
$form->editormd('content');
变更日志
2020-07-18(美国东部时间8点)
fix:修复模型关联属性不可用的bug。
feat:支持 JS 配置编辑器模式。(支持编辑器事件监控)
feat:重新设计组件UI以与 Laravel-admin 保持一致。
docs:改进基本文档
docs:添加中文README文档。
许可证
在 MIT许可证(MIT) 下授权。
