From d9413e88f38615be57bf63f27a287823098365c1 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Mon, 6 Jun 2022 16:17:31 +0800 Subject: [PATCH] fix tab --- src/views/dashboard/panel/Layout.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/dashboard/panel/Layout.vue b/src/views/dashboard/panel/Layout.vue index b54a23f2..02b93fea 100644 --- a/src/views/dashboard/panel/Layout.vue +++ b/src/views/dashboard/panel/Layout.vue @@ -29,7 +29,7 @@ limitations under the License. --> :h="item.h" :i="item.i" :key="item.i" - @click="clickGrid(item)" + @click="clickGrid(item, $event)" :class="{ active: dashboardStore.activedGridItem === item.i }" :drag-ignore-from="dragIgnoreFrom" > @@ -55,10 +55,13 @@ export default defineComponent({ const dashboardStore = useDashboardStore(); const selectorStore = useSelectorStore(); - function clickGrid(item: LayoutConfig) { + function clickGrid(item: LayoutConfig, event: Event) { dashboardStore.activeGridItem(item.i); dashboardStore.selectWidget(item); - if (item.type === "Tab") { + if ( + item.type === "Tab" && + (event.target as HTMLDivElement)?.className !== "tab-layout" + ) { dashboardStore.setActiveTabIndex(0); } }