|
阅读:9167回复:2
富文本编辑器
vue中用 富文本编辑器的方法
使用npm下载:npm install wangeditor (注意 wangeditor 全部是小写字母) 然后在需要使用的页面复制以下代码 <div id="editorElem" style="text-align:left"></div> <button v-on:click="getContent">发表</button> 在script中 import E from 'wangeditor'; export default { name: 'editor', data () { return { editorContent: '' } }, methods: { getContent: function () { console.log(this.editorContent); } }, mounted() { var editor = new E('#editorElem'); editor.customConfig.onchange = (html) => { this.editorContent = html }; editor.create() } } |
|
最新喜欢: |
|
沙发#
发布于:2018-07-09 16:22
666666666666666, you are good
|
|
|
板凳#
发布于:2017-12-20 09:32
赞赞赞
|
|
|