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

如何在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)營
97视频在线观看免费| 欧美日韩中文字幕精品| 色婷婷精品一区二区三区| 日韩亚洲欧洲一区二区三区| 日韩av一区二区三区在线| 99热视频这里只有精品| 日本一区二区精美视频| 麻豆国产免费av在线| 蜜臀国产综合久久第一页| 国产探花猛操性感美女| 亚洲国产中文字幕高清| 中文字幕国产成人在线视频| 国语对白精品视频在线| 亚洲精品熟女国产中文| 亚洲a∨乱码一区二区三区蜜臀 | 久久精品国产亚洲av不丁香| 国产欧美色日韩综合在线| 久久精品国产久精国产爱| 男人的天堂成人午夜视频| 中文字幕人妻紧贴拍摄| 亚洲黄色艳情视频录像| 成人福利网站午夜一区| 欧美日韩一区二区三区四区高清| 亚洲激情粉嫩中文字幕| 果冻国产精品麻豆成人av| 九九九热精品视频在线观看| 尤物视频在线观看一下| 末满18周岁禁止观看| 日本写真视频一区二区三区| 国产精品免费观看在线国产| 久久激情日本人妻av免费| 欧美视频综合一级91| 亚洲精品熟女国产国产老熟女| 国产欧美成人精品第一区| 国产男女做爰在线视频| 一区二区三区国产激情| 国产激情久久久久久影院| 97免费观看在线观看| 91在线直播观看高清| 最新欧美精品一区二区| 人妻少妇系列一区二区 |