Skip to content
Snippets Groups Projects
Commit f088c496 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

fix: handle disabled prop changes in quill editor

parent 3bb47ed7
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ Quill.register( ...@@ -32,7 +32,7 @@ Quill.register(
<script lang="ts" setup> <script lang="ts" setup>
import { unset } from 'lodash' import { unset } from 'lodash'
import { onBeforeUnmount, onMounted, ref } from 'vue' import { onBeforeUnmount, onMounted, ref, watch } from 'vue'
import { useEventListener } from '@vueuse/core' import { useEventListener } from '@vueuse/core'
const content = defineModel<string>({ required: true }) const content = defineModel<string>({ required: true })
...@@ -80,6 +80,11 @@ function initializeQuill(contentEl: HTMLElement) { ...@@ -80,6 +80,11 @@ function initializeQuill(contentEl: HTMLElement) {
quill.value = quillInstance quill.value = quillInstance
} }
watch(
() => props.disabled,
(disabled) => quill.value?.enable(!disabled),
)
onMounted(() => { onMounted(() => {
initializeQuill(contentEl.value as HTMLElement) initializeQuill(contentEl.value as HTMLElement)
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment