vue-quill-editor写好内容之后发给后端存储,然后前端再一次拉取后端的数据,怎么让编辑器显示拉取回来的数据

新手上路,请多包涵

在页面中使用如下方法用标签加载出了富文本编辑器

        <quill-editor
          ref="text"
          v-model="content"
          class="myQuillEditor"
          :options="editorOption"
        />

<script>
import { quillEditor } from "vue-quill-editor";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
export default {
  components: {
    quillEditor,
  },
data() {
    return {
        content: "",
        editorOption:{
            placeholder: "请在这里输入"
            }
        }
    }
</script>

写好内容之后可以通过this.$refs.text.value拿到所写的富文本发送到后台保存,但是数据拉取回来之后直接赋值给this.$refs.text.value会报错,报错内容如下

mutating a prop directly since the value will be overwritten whenever 
the parent component re-renders. Instead, use a data or computed property
based on the prop's value. Prop being mutated: "value"
阅读 4.5k
1 个回答

v-model = content. 你不应该操作 content 吗 ,怎么有操 dom 去了,双向绑定了解一下

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题