KindEditor is used in Vue

  1. Plug-in installation

npm install kindeditor

  1. Component introduction
import "kindeditor/themes/default/default.css";
import "kindeditor/kindeditor-all-min.js";
import "kindeditor/lang/zh-CN.js";
Copy the code
  1. HTML to addtextareaInput box
<textarea
id="kind_editor"
v-model="content"
style="width: 100%; min-height: 600px"
/>
Copy the code
  1. Initialize the
data(){ return { editor: null, content: "" } }, mounted(){ this.initEditor(); } methods: { initEditor(){ this.editor = window.KindEditor.create("#kind_editor"); }}Copy the code
  1. Initialization parameter

The official documentation

  1. To use