Open the page and get what"s in the content, but I don"t know how to put the content in this edit box
Open the page and get what"s in the content, but I don"t know how to put the content in this edit box
method for inserting HTML: editor.cmd.do ('insertHTML','
.
')wangEditor paste the code about the editor
<div v-html="content" @input="result" id="editor">
</div>
//js
props: ['content']
//
<v-editor :content="editorContent" v-model="article.content"></v-editor>
this.editorContent = data.content;
encapsulate components
<template>
<div>
<div
ref="editor"
style="text-align:left"
></div>
</div>
</template>
<script>
import WangEditor from "wangeditor";
export default {
name: "editor",
model: {
prop: "editorContent",
event: "change"
},
props: {
editorContent: { required: true }
},
mounted() {
/**/
var editor = new WangEditor(this.$refs.editor);
/**/
editor.customConfig.uploadImgServer = "/upload/image/";
editor.customConfig.uploadFileName = "fileToUpload";
editor.customConfig.uploadImgHooks = {
customInsert: function(insertImg, result, editor) {
var url = result.data;
insertImg(url);
}
};
/**/
editor.customConfig.onchange = html => {
this.$emit("change", html);
};
/**/
editor.create();
/**/
editor.txt.html(this.editorContent);
}
};
</script>
use components
<editor v-model="xxxx"/>
have you ever encountered the problem of not uploading pictures when wangeditor uses base64 to save pictures? the code is as follows <template> <div class="editor-wrap"> <div class="account-editor" ref...
I want to implement an editing operation. When I enter the page, I get the data from the background and insert the data into the rich text box. The data is requested, but the official method editor.txt.html () fails to insert the data into the text box...