From 5f6f8449518a814047aff34fbed75fdbbfa01809 Mon Sep 17 00:00:00 2001 From: xream Date: Sun, 17 Mar 2024 21:27:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=9D=9E=E8=A7=A6?= =?UTF-8?q?=E5=B1=8F=E8=AE=BE=E5=A4=87=E4=B8=8A=E7=9A=84=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FileListItem.vue | 6 ++++-- src/components/SubListItem.vue | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/FileListItem.vue b/src/components/FileListItem.vue index 9054c10de..990ba948c 100644 --- a/src/components/FileListItem.vue +++ b/src/components/FileListItem.vue @@ -303,14 +303,14 @@ if (swipeIsOpen.value) { swipe.value.close(); swipeIsOpen.value = false; - moreAction.value.style.transform = 'rotate(0deg)'; + if(moreAction.value) moreAction.value.style.transform = 'rotate(0deg)'; } else { if (isLeftRight.value) { swipe.value.open('right'); } else { swipe.value.open('left'); swipeIsOpen.value = true; - moreAction.value.style.transform = 'rotate(180deg)'; + if(moreAction.value) moreAction.value.style.transform = 'rotate(180deg)'; } } }; @@ -322,6 +322,7 @@ const onClickCopyConfig = async () => { + swipeController() const data = JSON.parse(JSON.stringify(toRaw(props.file))); data.name += `-copy${~~(Math.random() * 10000)}`; @@ -338,6 +339,7 @@ }; const onClickDelete = () => { + swipeController() Dialog({ title: t('subPage.deleteSub.title'), content: createVNode( diff --git a/src/components/SubListItem.vue b/src/components/SubListItem.vue index 0839cbda3..2044c01ac 100644 --- a/src/components/SubListItem.vue +++ b/src/components/SubListItem.vue @@ -421,14 +421,14 @@ const swipeController = () => { if (swipeIsOpen.value) { swipe.value.close(); swipeIsOpen.value = false; - moreAction.value.style.transform = "rotate(0deg)"; + if(moreAction.value) moreAction.value.style.transform = "rotate(0deg)"; } else { if (isLeftRight.value) { swipe.value.open("right"); } else { swipe.value.open("left"); swipeIsOpen.value = true; - moreAction.value.style.transform = "rotate(180deg)"; + if(moreAction.value) moreAction.value.style.transform = "rotate(180deg)"; } } }; @@ -459,6 +459,7 @@ const setTimeoutTF = () => { const onClickPreviews = () => { if (ismove.value) return; + swipeController() Dialog({ title: t("subPage.previewTitle"), content: createVNode(PreviewPanel, { @@ -486,6 +487,7 @@ const onClickPreviews = () => { }; const onClickCopyConfig = async () => { + swipeController() let data: Sub | Collection; switch (props.type) { case "sub": @@ -510,6 +512,7 @@ const onClickEdit = () => { }; const onClickDelete = () => { + swipeController() Dialog({ title: t("subPage.deleteSub.title"), content: createVNode(