vue-quill-editor 禁止编辑
时间: 2023-08-06 09:07:40 浏览: 1289
要禁止vue-quill-editor的编辑功能,可以使用以下方法。首先,在父级组件的mounted钩子函数中,通过this.$refs.editor.Quill.enable(false)来禁用编辑器。具体代码如下所示:
```html
<template>
<div>
<editor v-model="val" ref="editor"></editor>
</div>
</template>
<script>
import Editor from "@/components/Editor/index";
export default {
name: "",
components: {
Editor
},
data() {
return {
val: null
};
},
mounted() {
this.$nextTick(() => {
this.$refs.editor.Quill.enable(false);
});
}
};
</script>
```
这样,vue-quill-editor就会被禁止编辑了。你可以在mounted钩子函数中调用this.$refs.editor.Quill.enable(false)来实现禁用编辑器的效果。\[3\]
#### 引用[.reference_title]
- *1* *2* [vue-quill-editor 富文本编辑器禁用/不可编辑](https://blog.csdn.net/julying/article/details/81702646)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Quill富文本编辑器禁用](https://blog.csdn.net/qq_33475629/article/details/124615384)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文