美文网首页
Layedit 富文本编辑器 回显html code 问题

Layedit 富文本编辑器 回显html code 问题

作者: 残月星辰梦 | 来源:发表于2021-01-23 16:54 被阅读0次
 <textarea id="container" name="articleContent" class="layui-textarea " lay-verify="content" style="display: none; ">
                               </textarea>
//初始化编辑器
                var articleContent = '   <p><b>1</b></p><p><i>1</i></p><p>1</p>';//通过layui获取文本 ,存储到数据库中,返回显示的html code 
                $('#container').append(articleContent);//显示text, 如果此话 则显示html code,
                var container = layedit.build('container', {
                    height: 450, //设置编辑器高度
                    tool: [
                        'strong' //加粗
                        , 'italic' //斜体
                        , 'underline' //下划线
                        , 'del' //删除线
                        , '|' //分割线
                        , 'left' //左对齐
                        , 'center' //居中对齐
                        , 'right' //右对齐
                        , 'link' //超链接
                        , 'unlink' //清除链接
                        , 'face' //表情
                        , 'image' //插入图片
                    ]
                });

相关文章

网友评论

      本文标题:Layedit 富文本编辑器 回显html code 问题

      本文链接:https://www.haomeiwen.com/subject/xpjuzktx.html