From 4192acb8ff52b00e661ae5304e55bd0775b4d2b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=A5=87?= <40658369+yiqia@users.noreply.github.com> Date: Thu, 26 Oct 2023 15:05:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(swipe-cell):=20=E4=BF=AE=E5=A4=8Dt-swipe-ce?= =?UTF-8?q?ll=20=E5=9C=A8=20t-popup=20=E4=B8=AD=E6=97=A0=E6=B3=95=E5=B7=A6?= =?UTF-8?q?=E5=8F=B3=E6=BB=91=E5=8A=A8=20(#1141)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在移动开始时,重新获取内容宽度,修复该问题 fix #1055 --- src/swipe-cell/swipe-cell.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/swipe-cell/swipe-cell.vue b/src/swipe-cell/swipe-cell.vue index 78b09a383..864e5e0e4 100644 --- a/src/swipe-cell/swipe-cell.vue +++ b/src/swipe-cell/swipe-cell.vue @@ -181,6 +181,7 @@ export default defineComponent({ if (props.disabled) { return; } + setPanelWidth(); swipeDir = 0; initData.moved = false; initData.offset = initData.pos; @@ -231,12 +232,16 @@ export default defineComponent({ }, }); - const classes = computed(() => [`${name}`]); - onMounted(() => { + const setPanelWidth = () => { const leftWidth = leftRef.value?.clientWidth as number; const rightWidth = rightRef.value?.clientWidth as number; initData.leftWidth = leftWidth > 0 ? leftWidth : 0; initData.rightWidth = rightWidth > 0 ? rightWidth : 0; + }; + + const classes = computed(() => [`${name}`]); + onMounted(async () => { + setPanelWidth(); renderMenuStatus(); }); onUnmounted(() => {