富文本编辑器(协同办公系统-后勤日志管理)

富文本编辑器

下载地址:http://www.kindsoft.net/license.php

1.效果展示

在这里插入图片描述

2.下载的内容放到项目中

在这里插入图片描述

3.html页面

3.1head标签中引入

<link rel="stylesheet" type="text/css" href="../../static/kindeditor/themes/default/default.css">

3.2弹出框

​ dialog上需要绑定事件 @opened=“opened”,打开弹出框之后做富文本框的初始化 (见4.2步骤)

<el-form-item label=" 工作日志:" :rules="[{ required: false, message: '请输入工作内容' }]">
            <textarea id="editor" name="content"
                      style="width:700px;height:300px;"  v-model="editorValue"></textarea>
</el-form-item>

3.3JS引入

<script type="text/javascript" src="../../static/kindeditor/kindeditor-all.js"></script>
<script type="text/javascript" src="../../static/kindeditor/lang/zh-CN.js"></script>
4.js页面

4.1Vue对象外

KindEditor.ready(function(K) {
   window.editor = K.create('#editor');

});

4.2富文本框的初始化

opened:function(){
   // 打开Dialog之后创建编辑器
   this.editor =KindEditor.create('#editor', {
      minHeight:'350px',
      // allowFileManager : true,
      // uploadJson : contextPath + "/api/hrpRepairProblemProcess/portal/uploadFile",
      // afterUpload: function(){this.sync();}, //图片上传后,将上传内容同步到textarea中
      // afterBlur: function(){this.sync();},   失去焦点时,将上传内容同步到textarea中
      items:[
         'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
         'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
         'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
         'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
         'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
         'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'insertfile',
         'table', 'hr', 'emoticons', 'baidumap', 'pagebreak', 'link', 'unlink', '|', 'about'
      ]
   });
},
5.取值,清空
this.editor.html(); //取值
$("#editor").val(""); //清空
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值