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

如何在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)營
日本免费一区二区三区的电影啊| 久久亚洲中文字幕精品熟女| 欧美一区二区三区蜜桃| 国产老熟女高潮视频| 传媒视频免费在线观看| 中国女人内射91熟女| 色哟哟网站一区二区精品久久| 国产精品久久一区二区三区蜜桃| 凹凸69堂国产成人精品| 国产高跟丝袜女王调教| 黄色成人av免费看| 亚洲av偷拍一区二区三区不卡| 日本高清不卡在线播放| 亚洲成人免费在线播放| 久久亚洲精品综合一区| 亚洲精品乱码精品乱码不卡| 久久精品亚洲天然东京热| 国产日韩精品一区二区三区在线| 国产精品av国产精华液| 亚洲国产欧美日韩久久| 国产高清内射一级一片高清视频| 色婷婷激情一区二区三区| 亚洲精品av在线网站| 欧美亚洲精品在线观看| 一区二区三区av天堂| 国产真实精品对白又爽欧美| 日本午夜熟女九色视频| 亚洲一区二区三区免费在线看| 激情四射五月天亚洲婷婷| 亚洲综合精品久久久一区| 天堂中文在线官网在线 | 亚洲女优中文字幕在线免费| 亚洲国产日韩欧美视频二区| 婷婷不卡中文字幕三区| 欧美日韩一区二区午夜福利| 国产农村妇女一区二区三区| 亚洲欧洲日韩另类在线| 一区二区三区四区在线视频观看| 色综合久久综合香梨网| 欧美日韩精品一区二区视频永久免 | 国产情色自拍在线观看|