From a8fa56ce135d401f4cdfcea24cc8ea5a6eef2eec Mon Sep 17 00:00:00 2001 From: qinwencheng <157475034@qq.com> Date: Wed, 6 Jul 2022 10:53:44 +0800 Subject: [PATCH] fix(useDrauu): fix Eraser does not work (#1753) Co-authored-by: Anthony Fu --- packages/integrations/useDrauu/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/integrations/useDrauu/index.ts b/packages/integrations/useDrauu/index.ts index befc8e3881c..e6924c82182 100644 --- a/packages/integrations/useDrauu/index.ts +++ b/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' @@ -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()