From 5dfb686c5793e39870069049094ef868826225ee Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 11 Jun 2024 18:01:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=AA=E8=A1=A8=E6=9D=BF=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=8E=A5=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-component/de-tabs/Component.vue | 144 +++++++++--------- .../de-tabs/CustomTabsSort.vue | 2 + 2 files changed, 75 insertions(+), 71 deletions(-) diff --git a/core/core-frontend/src/custom-component/de-tabs/Component.vue b/core/core-frontend/src/custom-component/de-tabs/Component.vue index fbe4866228..8a00528aaf 100644 --- a/core/core-frontend/src/custom-component/de-tabs/Component.vue +++ b/core/core-frontend/src/custom-component/de-tabs/Component.vue @@ -14,68 +14,65 @@ :border-color="noBorderColor" :border-active-color="borderActiveColor" > - - element.value.propValue || [{ name: '1', label: 'Tab 1', content: 'Content 1' }] -) - const isEditMode = computed(() => editMode.value === 'edit' && isEdit.value && !mobileInPc.value) -const onMove = evt => { - // do custom - return true -} - const calcTabLength = () => { setTimeout(() => { if (element.value.propValue.length > 1) { @@ -391,6 +379,13 @@ const activeCanvasId = computed(() => { return element.value.id + '--' + editableTabsValue.value }) +const reShow = () => { + state.tabShow = false + nextTick(() => { + state.tabShow = true + }) +} + onMounted(() => { if (element.value.propValue.length > 0) { editableTabsValue.value = element.value.propValue[0].name @@ -398,8 +393,15 @@ onMounted(() => { calcTabLength() eventBus.on('onTabMoveIn-' + element.value.id, componentMoveIn) eventBus.on('onTabMoveOut-' + element.value.id, componentMoveOut) + eventBus.on('onTabSortChange-' + element.value.id, reShow) currentInstance = getCurrentInstance() }) + +onBeforeMount(() => { + eventBus.off('onTabMoveIn-' + element.value.id, componentMoveIn) + eventBus.off('onTabMoveOut-' + element.value.id, componentMoveOut) + eventBus.off('onTabSortChange-' + element.value.id, reShow) +})