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

鍍金池/ 問答/HTML/ vue + UEditor 第一次富文本加載不出來 但刷新后會(huì)加載出來

vue + UEditor 第一次富文本加載不出來 但刷新后會(huì)加載出來

vue + UEditor 開發(fā)第一次什么反應(yīng)都沒有 刷新后才會(huì)加載出來

UEditor 組件

<template>
    <script :id=id type="text/plain"></script>
</template>
<script>
  import * as _ from '../util/tool';
  export default {
    name: 'UE',
    data () {
      return {
        editor: null,
        flag:true,
      }
    },
    props: {
      defaultMsg: {
        type: String
      },
      config: {
        type: Object
      },
      id: {
        type: String
      }
    },
    activated() {
      this.init();
    },
    methods: {
      init(){
        if(!UE.Editor.prototype._bkGetActionUrl){
          UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;//修改圖片上傳地址
          UE.Editor.prototype.getActionUrl = function(action) {
              if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadfile' || action =='uploadvideo') {
                  return '/ueditor/upload.html';
              } else {
                  return this._bkGetActionUrl.call(this, action);
              }
            };
        };
        let _this = this;
        this.editor = UE.getEditor(_this.id, _this.config); // 初始化UE
      },
      getUEContent() { // 獲取內(nèi)容
        return this.editor.getContent()
      },
      setUEContent(val) { // 設(shè)置內(nèi)容
        return this.editor.setContent(val);
      },
      getUEContentText(){ // 獲取純文本內(nèi)容
        return this.editor.getContentTxt();
      },
      destroyed(){
        return this.editor.destroy();
      }
    },
    deactivated() {
        //銷毀編輯器實(shí)例,使用textarea代替
        //this.editor.destroy()
        //重置編輯器,可用來做多個(gè)tab使用同一個(gè)編輯器實(shí)例
        //如果要使用同一個(gè)實(shí)例,請注釋destroy()方法
        this.editor.reset()
    }
  }
</script>

組件中調(diào)用

~ ~ ~
data(){
    return {
        Ueditor: 'ue1',
        config: {
                  initialFrameWidth: null,
                  initialFrameHeight: 350
                },
    }
}
~ ~ ~


 <UE ref="bdeditor" :id="Ueditor" :config=config></UE>

但是我重新登錄后會(huì)什么都不顯示

clipboard.png

刷新后會(huì)顯示出來

clipboard.png

會(huì)不會(huì)和緩存有關(guān)系

各位大佬幫我看一下

回答
編輯回答
雅痞

activated keep-alive組件激活時(shí)調(diào)用 免不了是這個(gè)緣故

2017年9月26日 10:30