Skip to content

Commit

Permalink
fix(useDrauu): fix Eraser does not work (#1753)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
qinwencheng and antfu committed Jul 6, 2022
1 parent 29fd5ef commit a8fa56c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/integrations/useDrauu/index.ts
@@ -1,6 +1,6 @@
import type { Ref } from 'vue-demi'
import { ref, watch } from 'vue-demi'
import type { Brush, Drauu, Options } from 'drauu'
import type { Brush, Drauu, DrawingMode, Options } from 'drauu'
import { createDrauu } from 'drauu'
import type { EventHookOn, MaybeElementRef } from '@vueuse/core'
import { createEventHook, unrefElement } from '@vueuse/core'
Expand Down Expand Up @@ -66,8 +66,10 @@ export function useDrauu(
watch(brush, () => {
const instance = drauuInstance.value

if (instance)
if (instance) {
instance.brush = brush.value
instance.mode = brush.value.mode as DrawingMode
}
}, { deep: true })

const undo = () => drauuInstance.value?.undo()
Expand Down

0 comments on commit a8fa56c

Please sign in to comment.