From dc1ff2ea4905f16b62984903587543b8690d7698 Mon Sep 17 00:00:00 2001 From: wcq Date: Wed, 14 Apr 2021 18:58:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20resetSlides=E6=96=B9=E6=B3=95=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0background=E5=B9=B6=E4=BD=BF=E7=94=A8=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useSlideHandler.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/hooks/useSlideHandler.ts b/src/hooks/useSlideHandler.ts index 7c8e6421..9ba258b0 100644 --- a/src/hooks/useSlideHandler.ts +++ b/src/hooks/useSlideHandler.ts @@ -25,12 +25,17 @@ export default () => { // 重置幻灯片 const resetSlides = () => { + const emptySlide = { + id: createRandomCode(8), + elements: [], + background: { + type: 'solid', + color: theme.value.backgroundColor, + }, + } store.commit(MutationTypes.UPDATE_SLIDE_INDEX, 0) store.commit(MutationTypes.SET_ACTIVE_ELEMENT_ID_LIST, []) - store.commit(MutationTypes.SET_SLIDES, [{ - id: createRandomCode(), - elements: [], - }]) + store.commit(MutationTypes.SET_SLIDES, [emptySlide]) } /**