diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index 20afe2fb..29b14408 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -207,9 +207,11 @@ export const dashboardStore = defineStore({ }, removeTabItem(item: LayoutConfig, index: number) { const idx = this.layout.findIndex((d: LayoutConfig) => d.i === item.i); - for (const item of this.layout[idx].children[index].children) { - if (this.selectedGrid.i === item.i) { - this.selectedGrid = null; + if (this.selectedGrid) { + for (const item of this.layout[idx].children[index].children) { + if (this.selectedGrid.i === item.i) { + this.selectedGrid = null; + } } } if (this.layout[idx].children) { @@ -271,6 +273,7 @@ export const dashboardStore = defineStore({ }; this.selectedGrid = this.layout[index].children[tabIndex].children[itemIndex]; + this.setCurrentTabItems(this.layout[index].children[tabIndex].children); return; } this.layout[index] = { diff --git a/src/views/dashboard/controls/Tab.vue b/src/views/dashboard/controls/Tab.vue index 3c8a1fe2..0237f938 100644 --- a/src/views/dashboard/controls/Tab.vue +++ b/src/views/dashboard/controls/Tab.vue @@ -56,9 +56,8 @@ limitations under the License. --> :row-height="10" :is-draggable="true" :is-resizable="true" - :vertical-compact="true" - :use-css-transforms="true" :responsive="true" + @layout-updated="layoutUpdatedEvent" > :row-height="10" :is-draggable="true" :is-resizable="true" - :responsive="true" @layout-updated="layoutUpdatedEvent" >