目錄
- 預覽
- 思路
- 調用代碼
- 借助Props添加isDisable屬性控制 是否內容可編輯
- 總結
歡迎關注 『VUE』 專欄,持續更新中
歡迎關注 『VUE』 專欄,持續更新中
預覽
思路
禁用焦點事件和內容改變事件
調用代碼
<quillEditorclass="editor":class="[size]"v-model="content"ref="myQuillEditor":options="editorOption"@blur="onEditorBlur($event)"@focus="onEditorFocus($event)"@change="onEditorChange($event)"></quillEditor>
借助Props添加isDisable屬性控制 是否內容可編輯
props: {isDisable: {type: Boolean,default: false},
onEditorFocus(editor) {if (this.isDisable) {editor.enable(false);} else {//獲得焦點事件后你原本要做的操作}},onEditorChange(editor) {if (this.isDisable) {editor.quill.enable(false);} else {//內容改變時間后 你原本進行的操作}},
總結
大家喜歡的話,給個👍,點個關注!給大家分享更多計算機專業學生的求學之路!
版權聲明:
發現你走遠了@mzh原創作品,轉載必須標注原文鏈接
Copyright 2024 mzh
Crated:2024-3-1
歡迎關注 『VUE』 專欄,持續更新中
歡迎關注 『VUE』 專欄,持續更新中
『未完待續』