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

如何在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://www.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| 久久免费少妇高潮99精品| 亚洲欧美日韩精品麻豆| 未满十八禁止观看免费观看| 久久久久久精品国产免费| 国产一级精品自拍视频| 麻豆视频国产一区二区| 亚洲日本在线观看午夜视频| av中文字幕一二三区| 麻豆印象传媒在线观看| 久久精品有码视频免费观看| 人妻中文字幕av资源| 亚洲熟妇av一区二区| 未满十八勿进黄网观看| 国产精品乱人偷免费视频| 亚洲视频在线视频看视频在线| 欧美日韩一区二区三区四区在线观看| 91高清国产在线播放| 五月婷婷丁香视频在线| 日韩精品专区中文字幕| 中文字幕在线一区国产精品| 欧美日韩另类激情免费| 韩国av毛片在线播放| 日本在线看片一区二区| 亚洲成年人黄片在线播放| 日本一级a级黄免视频| 国产一级二级三级在线电影| 毛片一区二区三区免费看| 欧美日韩一区二区三区色| 亚洲天堂免费在线播放| 国产精品欧美日韩中文| 亚洲视一区二区三区四区| 国产成人亚洲综合色影视| 高清不卡一区二区在线观看| 日本视频三区在线播放| 欧美精品欧美精品一区二区| 国家成人午夜在线观看| 日韩av不卡免费播放| 一卡二卡精品在线免费| 淫色网av人妻中文字幕|