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(() => {