vue 引入ckeditor 方式

1 引入ckeditor.js文件到index.html

2 (1)可以直接通过 npm i vue-ckeditor 安装,安装后再webpack.base.conf.js 里面module.export配置 

externals: {

"CKEDITOR": "window.CKEDITOR"

},

2 (2) 也可以 不使用vue-ckeditor,直接

  <div class="ckeditor">

    <textarea :id="id" :value="value"></textarea>

  </div>

在mounted()初始化,具体一些细节操作,看ckeditor文档

CKEDITOR.replace(ckeditorId, ckeditorConfig)

CKEDITOR.instances[ckeditorId].setData(this.value)

猜你喜欢

转载自blog.csdn.net/adsadadaddadasda/article/details/83105140