From 8f141fd49e3bc50a05964fb9881b4d2431a4991a Mon Sep 17 00:00:00 2001 From: pipipi-pikachu Date: Sun, 29 Oct 2023 16:55:34 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E8=87=AA=E5=AE=9A=E4=B9=89=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=AE=9E=E4=BE=8B=E7=B1=BB=E5=9E=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Screen/WritingBoardTool.vue | 4 +++- .../components/element/AudioElement/ScreenAudioElement.vue | 2 +- src/views/components/element/ShapeElement/index.vue | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/Screen/WritingBoardTool.vue b/src/views/Screen/WritingBoardTool.vue index aec875e8..6b620df8 100644 --- a/src/views/Screen/WritingBoardTool.vue +++ b/src/views/Screen/WritingBoardTool.vue @@ -117,7 +117,7 @@ const emit = defineEmits<{ const { currentSlide } = storeToRefs(useSlidesStore()) -const writingBoardRef = ref() +const writingBoardRef = ref>() const writingBoardColor = ref('#e2534d') const writingBoardModel = ref('pen') const blackboard = ref(false) @@ -164,6 +164,8 @@ watch(currentSlide, () => { // 每次绘制完成后将绘制完的图片更新到数据库 const hanldeWritingEnd = () => { const dataURL = writingBoardRef.value!.getImageDataURL() + if (!dataURL) return + db.writingBoardImgs.where('id').equals(currentSlide.value.id).toArray().then(ret => { const currentImg = ret[0] if (currentImg) db.writingBoardImgs.update(currentImg, { dataURL }) diff --git a/src/views/components/element/AudioElement/ScreenAudioElement.vue b/src/views/components/element/AudioElement/ScreenAudioElement.vue index 69729a9d..d2ee02a7 100644 --- a/src/views/components/element/AudioElement/ScreenAudioElement.vue +++ b/src/views/components/element/AudioElement/ScreenAudioElement.vue @@ -83,7 +83,7 @@ const audioPlayerPosition = computed(() => { } }) -const audioPlayerRef = ref() +const audioPlayerRef = ref>() const toggle = () => { if (!audioPlayerRef.value) return audioPlayerRef.value.toggle() diff --git a/src/views/components/element/ShapeElement/index.vue b/src/views/components/element/ShapeElement/index.vue index 54eca8d7..83630d0f 100644 --- a/src/views/components/element/ShapeElement/index.vue +++ b/src/views/components/element/ShapeElement/index.vue @@ -177,7 +177,7 @@ const checkEmptyText = () => { } } -const prosemirrorEditorRef = ref() +const prosemirrorEditorRef = ref>() const startEdit = () => { editable.value = true nextTick(() => prosemirrorEditorRef.value && prosemirrorEditorRef.value.focus())