最近项目中刚用到 import Editor from 'wangeditor' export default { methods: { initEditor() { var editor = new Editor('#editor') // editor.customConfig.uploadImgShowBase64 = true // editor.customConfig.uploadImgServer = '/upload' editor.customConfig.uploadImgServer = '/upload'; editor.customConfig.uploadFileName = 'uploadfile'; editor.customConfig.uploadImgHooks = { customInsert: function (insertImg, result, editor) { var url = result.url insertImg(url) } } editor.customConfig.customAlert = (info) => { this.$Notice.info({title: info}) } editor.customConfig.onchange = (html) => { this.form.content = html } editor.create() } }, mounted() { this.initEditor() }
最近项目中刚用到