This commit is contained in:
Qiuxia Fan 2022-06-06 16:17:31 +08:00
parent 852662a0f0
commit d9413e88f3

View File

@ -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);
}
}