laravel-admin 的 Simplemde markdown 编辑器扩展

v1.0.1 2018-12-06 02:51 UTC

This package is auto-updated.

Last update: 2024-09-13 22:49:31 UTC


README

Simplemde 是一个优秀的 markdown 编辑器,这个扩展用于将 Simplemde 集成到 laravel-admin 表单中。

截图

wx20180906-130207

安装

composer require laravel-admin-ext/simplemde

然后

php artisan vendor:publish --tag=laravel-admin-simplemde

配置

config/admin.php 文件的 extensions 部分中,添加属于此扩展的一些配置。

    'extensions' => [

        'simplemde' => [
        
            // Set to false if you want to disable this extension
            'enable' => true,
            
            // If you want to set an alias for the calling method
            //'alias' => 'markdown',
            
            // Editor configuration
            'config' => [
                
            ]
        ]
    ]

编辑器的配置可以在 Simplemde 文档 中找到。

    'config' => [
        'autofocus'   => true,
        'placeholder' => 'xxxx',
        ....
    ]

使用方法

在表单中使用它

$form->simplemde('content');

设置高度

$form->simplemde('content')->height(500);

如果配置中指定了方法别名是 markdown

$form->markdown('content');

捐赠

通过捐赠一小笔资金来帮助项目持续发展。提前感谢。

PayPal Me

-1

许可证

MIT 许可证 (MIT) 下授权。