鍍金池/ 問答/網(wǎng)絡(luò)安全/ wangEditor全屏插件在vue中怎么使用

wangEditor全屏插件在vue中怎么使用

如題,還是技術(shù)小白,真不知道該怎么合適的引入,請教教!
這個(gè)插件在vue中應(yīng)該怎么寫?
圖片描述

回答
編輯回答
終相守

最近項(xiàng)目中剛用到

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()
    }
2018年6月22日 09:27