This commit is contained in:
Qiuxia Fan 2022-03-25 15:11:39 +08:00
parent 5593416257
commit f0535ddf03
2 changed files with 4 additions and 4 deletions

View File

@ -179,10 +179,9 @@ export const dashboardStore = defineStore({
activeGridItem(index: string) {
this.activedGridItem = index;
},
setActiveTabIndex(index: number) {
const idx = this.layout.findIndex(
(d: LayoutConfig) => d.i === this.activedGridItem
);
setActiveTabIndex(index: number, target?: number) {
const m = target || this.activedGridItem;
const idx = this.layout.findIndex((d: LayoutConfig) => d.i === m);
if (idx < 0) {
return;
}

View File

@ -150,6 +150,7 @@ export default defineComponent({
dashboardStore.setCurrentTabItems(
dashboardStore.layout[l].children[activeTabIndex.value].children
);
dashboardStore.setActiveTabIndex(activeTabIndex.value, props.data.i);
}
function clickTabs(e: Event, idx: number) {