From b781e8e83aa4a71ffb0725d5d1811af3c4e666e1 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 20 Dec 2021 17:34:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20tabs=E7=BB=84=E4=BB=B6=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/SettingMenu.vue | 2 +- frontend/src/components/widget/DeWidget/DeTabs.vue | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/SettingMenu.vue b/frontend/src/components/canvas/components/Editor/SettingMenu.vue index 70aea3a8b4..9a9a5b3c20 100644 --- a/frontend/src/components/canvas/components/Editor/SettingMenu.vue +++ b/frontend/src/components/canvas/components/Editor/SettingMenu.vue @@ -142,7 +142,7 @@ export default { }) }, addTab() { - bus.$emit('add-new-tab') + bus.$emit('add-new-tab', this.curComponent.id) }, // 跳转设置 linkJumpSet() { diff --git a/frontend/src/components/widget/DeWidget/DeTabs.vue b/frontend/src/components/widget/DeWidget/DeTabs.vue index 2a5e45ed5a..65a84e3e67 100644 --- a/frontend/src/components/widget/DeWidget/DeTabs.vue +++ b/frontend/src/components/widget/DeWidget/DeTabs.vue @@ -134,10 +134,14 @@ export default { tabList: [] } }, + computed: { + ...mapState([ + 'curComponent' + ]) + }, watch: { curComponent: { handler(newVal, oldVla) { - console.log(newVal) }, deep: true } @@ -147,11 +151,6 @@ export default { this.tabList = this.element.options && this.element.options.tabList this.activeTabName = this.tabList[0].name }, - computed: { - ...mapState([ - 'curComponent' - ]) - }, methods: { beforeHandleCommond(item, param) { return { @@ -244,7 +243,8 @@ export default { this.styleChange() }, - addNewTab() { + addNewTab(componentId) { + if (!componentId || componentId !== this.element.id) return const curName = uuid.v1() const tab = { title: 'NewTab',