KindEditor is used in Vue
- Plug-in installation
npm install kindeditor
- Component introduction
import "kindeditor/themes/default/default.css";
import "kindeditor/kindeditor-all-min.js";
import "kindeditor/lang/zh-CN.js";
Copy the code
- HTML to add
textarea
Input box
<textarea
id="kind_editor"
v-model="content"
style="width: 100%; min-height: 600px"
/>
Copy the code
- Initialize the
data(){ return { editor: null, content: "" } }, mounted(){ this.initEditor(); } methods: { initEditor(){ this.editor = window.KindEditor.create("#kind_editor"); }}Copy the code
- Initialization parameter
The official documentation
- To use