欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

如何在vue中使用ueEditor編輯器-創(chuàng)新互聯(lián)

如何在vue中使用ueEditor編輯器?相信很多沒有經(jīng)驗(yàn)的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。

站在用戶的角度思考問題,與客戶深入溝通,找到宕昌網(wǎng)站設(shè)計(jì)與宕昌網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗(yàn)好的作品,建站類型包括:網(wǎng)站制作、成都網(wǎng)站設(shè)計(jì)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、申請域名虛擬主機(jī)、企業(yè)郵箱。業(yè)務(wù)覆蓋宕昌地區(qū)。

1. 安裝  npm i vue-ueditor --save-dev

2.從nodemodels  取出ueditor1_4_3_3 這整個目錄,放入vue 的 static 目錄

3.配置 ueditor.config.js 的  21行代碼  更改路徑   var URL = '/static/ueditor1_4_3_3/' || getUEBasePath(); 

 (1)     serverUrl: URL + 'php/controller.php',  這里是你配置的上傳內(nèi)容的 url ;不需要可以刪除;

?。?) 部分人使用時出現(xiàn)以下報錯:
    Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them...
    這個問題是因?yàn)轫?xiàng)目中的使用的babel默認(rèn)添加了use strict造成,可參考 https://segmentfault.com/q/1010000007415253
    我采用的是鏈接中答案的第三種方式:添加了babel-plugin-transform-remove-strict-mode,并在.babelrc里添加下列代碼;

    2-1.1   或者在webpack.base.conf.js 添加 

loaders: [{
    test: /\.js$/,
    exclude: /(node_modules|bower_components)/,
    loader: 'babel',
    query: {
    presets: ['es2015']
  }}]

4.如果不需要以組建的方式引入 則 可以這么寫 ;

<VueUeditor ueditorPath="./../../static/ueditor/" @ready="editorReady"></VueUeditor>
<script>
 import VueUeditor from 'vue-ueditor';
 import ueditor from '../components/UE';
 export default {
  components: {VueUeditor,ueditor},
  data() {
   return {
    defaultMsg: '這里是UE測試',
    content1: '這里是UE',
    ue1: "ue1",
    config: {
     initialFrameWidth: 800,
     initialFrameHeight: 350
    }
   }
  },
  methods: {
    getUEContent() {
    // 獲取ueditor值
      let content1 = UE.getEditor(this.ue1).getContentTxt();;
      console.log(content1)
  }, 
    editorReady(editorInstance){
      editorInstance.setContent("哈哈哈")
    }
  }
 };

  5.如果要自定義組件的方式 在每個頁面引入 則  在components 中新建ue.vue 文件 貼入這個代碼

<template>
    <script :id=id type="text/plain"></script>
</template>
<script>
  export default {
    name: 'UE',
    data() {
      return {
        editor: null
      }
    },
    props: {
      content: {
        type: String,
        default:''
      },
      config: {
        type: Object,
      },
      id: {
        type: String
      }
    },
    mounted() {
      const _this = this;
      _this.editor = UE.getEditor(_this.id, _this.config); // 初始化UE
      _this.editor.addListener("ready", function () {
        _this.editor.setContent(_this.content); // 確保UE加載完成后,放入內(nèi)容。
      });
    },
    methods: {
      getContent() { 
          // 獲取內(nèi)容方法
        return this.editor.getContentTxt();;
      }
    },
    destroyed() {
      this.editor.destroy();
    },
  }
</script>

然后就可以   import ueditor from '../components/UE';   //引入

<ueditor :content=content1 :config=config :id="ue1"></ueditor> //使用
<script>
 import VueUeditor from 'vue-ueditor';
 import ueditor from '../components/UE';
 export default {
  components: {VueUeditor,ueditor},
  data() {
   return {
    defaultMsg: '這里是UE測試',
    content1: '這里是UE',
    ue1: "ue1",
    config: {
     initialFrameWidth: 800,
     initialFrameHeight: 350
    }
   }
  },
  methods: {
     getUEContent() {
    // 獲取ueditor值
      let content1 = UE.getEditor(this.ue1).getContentTxt();;
      console.log(content1)
    },
    editorReady(editorInstance){
       editorInstance.setContent("哈哈哈")
     }
  }
 };
</script>

  這樣就可以了。

  附配置清單

1. 實(shí)例化編輯器到id為 container 的 dom 容器上:
   var ue = UE.getEditor('container');
2. 設(shè)置編輯器內(nèi)容:
    ue.setContent('<p>hello!</p>');
3. 追加編輯器內(nèi)容:
    ue.setContent('<p>new text</p>', true);
4. 獲取編輯器html內(nèi)容:
    var html = ue.getContent();
5. 獲取純文本內(nèi)容:
    ue.getContentTxt();
6. 獲取保留格式的文本內(nèi)容:
    ue.getPlainTxt();
7. 判斷編輯器是否有內(nèi)容:
    ue.hasContents();
8. 讓編輯器獲得焦點(diǎn):
    ue.focus();
9. 讓編輯器失去焦點(diǎn)
    ue.blur();
10. 判斷編輯器是否獲得焦點(diǎn):
    ue.isFocus();
11. 設(shè)置當(dāng)前編輯區(qū)域不可編輯:
    ue.setDisabled();
12. 設(shè)置當(dāng)前編輯區(qū)域可以編輯:
    ue.setEnabled();
13. 隱藏編輯器:
    ue.setHide();
14. 顯示編輯器:
    ue.setShow();
15. 清空內(nèi)容:
    ue.execCommand('cleardoc');
16. 讀取草稿箱:
    ue.execCommand('drafts');
17. 清空草稿箱:
  ue.execCommand('clearlocaldata');

看完上述內(nèi)容,你們掌握如何在vue中使用ueEditor編輯器的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!

網(wǎng)站題目:如何在vue中使用ueEditor編輯器-創(chuàng)新互聯(lián)
當(dāng)前網(wǎng)址:http://aaarwkj.com/article20/dpgpjo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、網(wǎng)站制作、Google、全網(wǎng)營銷推廣、網(wǎng)頁設(shè)計(jì)公司、關(guān)鍵詞優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營
亚洲人午夜射精精品日韩| 成人污视频网站在线观看| 久久人热视频这里只有精品| 日本人妻成人免费大片| 成人综合影视中文字幕| 蜜臀av午夜福利在线| 男女性情视频免费大全网站| 日韩精品一区高清视频| 日韩av有码在线播放| 亚洲综合另类视频在线观看| 亚洲国模av一区二区三区| 欧美三级在线完整版免费| 18禁的视频在线观看| 国产三级三级三级免费看| 精品欧美不卡在线播放| 男女互射视频在线观看| 久久日韩制服丝袜人妻| 国产在线乱码一区二区| 成人免费在线观看午夜| 欧美另类亚洲综合久青草| 99久在线观看精品视频| 亚洲欧美国产另类精品| 久久综合婷婷亚洲五月| 四虎在线经典视频播放| 国产精品传媒在线观看网站| 日韩中字在线一区二区| 日韩精品高清不卡一区二区三区 | 日本人妻成人免费大片| 亚洲av网站女性向在线观看| 亚洲社区一区二区三区四区| 日韩一级黄色片在线播放| 亚洲日本中文字幕免费观看| 欧美黄片高清免费播放| 人人狠狠综合久久亚洲| 成年自拍视频在线观看| 国产极品嫩模在线观看91| 国产精品夫妇在线激情啪| 中出亚洲精品日韩在线视频| 免费人成视频在线观看不卡| 国产日韩精品国产二区| 香婷婷一区二区精品久久|