在Vue專案中使用kindEditor編譯器

2021-08-14 06:31:20 字數 962 閱讀 8228

裡面有大量的demo,可根據需求自行選擇。

我在專案中選用kindeditor是因為它的體積比較小(2m多)。(ueditor編譯器7m多)

在專案中寫入:

html

id="content2"

name="content"

style="width:700px;height:350px;visibility:hidden;"

onkeyup="this.value=this.value.replace(/^\s+|\s+$/g,'')">

textarea>;

js:

function

htmlencode

(s)kindeditor.ready(function

(k)

});//提交按鈕

k('button[name=gethtml]').click(function

(e) );

//清空按鈕

k('button[name=clear]').click(function

(e) );

});

//在提交編輯器裡的內容的時候,需要將html_k轉碼一下,

html_k = encodeuricomponent(html_k);

axios(

}).then(function

(res)

).catch(function

(res)

);

在拿到上邊所傳的html_t的時候,同樣需要轉碼才可以變成我們之前所輸入的文字。

vm.content = decodeuricomponent(response.data

.content);

以上為個人使用方式,如有錯誤,望指點。

在 Vue 專案中使用 ECharts

重要檔案版本 在 vue 專案中使用 echarts 只需要在 vue 元件的mounted生命週期中 初始化 echarts,然後在每次配置項有變更時呼叫setoption 方法更新配置即可 專案模板原始碼 class default chart style div template import...

在vue專案中使用echarts

安裝echarts依賴 npm install echarts s 建立圖表 全域性引入 main.js 引入echarts import echarts from echarts vue.prototype.echarts echarts 這裡也可以在router下index.js引入,看規定 h...

在vue專案中使用ueditor

從ueditor的官網ueditor編輯器,官網位址為 將上述ueditor資料夾拷貝到vue專案的static資料夾中,此資料夾為專案的靜態服務資料夾 2.修改配置 在ueditor.config.js中修改如下 window.ueditor home url static ueditor var...