mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-05 19:41:44 +08:00
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
{extend name='extra@admin/content'}
|
|
|
|
{block name="content"}
|
|
|
|
<!--<div class="code">-->
|
|
<!--<blockquote class="site-text layui-elem-quote">-->
|
|
<!--富文本编辑器-->
|
|
<!--</blockquote>-->
|
|
<div style="position:relative">
|
|
<textarea name="content">这里可以放默认值</textarea>
|
|
<script>
|
|
require(['ckeditor'], function () {
|
|
var editor = window.createEditor('[name="content"]');
|
|
// 设置内容
|
|
editor.setData('修改内容');
|
|
// 获取内容
|
|
var content = editor.getData();
|
|
console.log(content);
|
|
});
|
|
</script>
|
|
</div>
|
|
|
|
<pre class="layui-code" lay-title="HTML代码">
|
|
|
|
<textarea name="content">这里可以放默认值</textarea>
|
|
</pre>
|
|
|
|
<pre class="layui-code" lay-title="javascript代码">
|
|
|
|
require(['ckeditor'], function () {
|
|
var editor = window.createEditor('[name="content"]');
|
|
// 设置内容
|
|
editor.setData('修改内容');
|
|
// 获取内容
|
|
var content = editor.getData();
|
|
console.log(content);
|
|
});
|
|
|
|
</pre>
|
|
</div>
|
|
|
|
<script>
|
|
layui.use('code', function () {
|
|
layui.code({encode: true});
|
|
});
|
|
</script>
|
|
{/block} |