在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/網(wǎng)絡(luò)安全  HTML/ wangeditor 使用 base64 保存圖片失敗

wangeditor 使用 base64 保存圖片失敗

請問有遇到過wangeditor 使用base64保存圖片時(shí) 上傳不上圖片的問題嗎。

clipboard.png
代碼如下

<template>
    <div class="editor-wrap">
        <div class="account-editor" ref="editor"></div>
    </div>
</template>
<script>
import WangEditor from 'wangeditor';
export default {
    name:'editor',
    data(){
        return{
            editor: '',  // 存放實(shí)例化的wangEditor對象,在多個(gè)方法中使用
        }
    },
    props:['catchData'],
    methods: {
        createEditor(){  // 創(chuàng)建編輯器
            this.editor = new WangEditor(this.$refs.editor);
            this.initEditorConfig();  // 初始化編輯器配置,在create之前
            this.editor.customConfig.onchange = (html) => {
                this.editorContent = html;
                this.catchData(html)  //把這個(gè)html通過catchData的方法傳入父組件
            }
            this.editor.create();  // 生成編輯器
        },
        initEditorConfig(){  // 初始化編輯器配置
            this.editor.customConfig.uploadImgShowBase64 = true;   // 使用 base64 保存圖片
        },
    },
    mounted(){
        this.createEditor()
    }
}
</script>

上傳時(shí)不顯示圖片也不報(bào)錯(cuò),有遇到過的嗎?

回答
編輯回答
還吻

需要聚焦 div如果上來就點(diǎn)擊上傳圖片的話是不行的 需要先點(diǎn)擊一下div的框 然后才可以

2017年4月30日 01:37