@peng_kai/kit 0.3.0-beta.15 → 0.3.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -277,7 +277,10 @@ export function getMenusByRouter(router: Router) {
|
|
|
277
277
|
key: name,
|
|
278
278
|
label: route.meta.title ?? name,
|
|
279
279
|
icon: route.meta.icon,
|
|
280
|
-
trigger: () =>
|
|
280
|
+
trigger: () => {
|
|
281
|
+
if (router.currentRoute.value.name !== name)
|
|
282
|
+
router.push({ name })
|
|
283
|
+
},
|
|
281
284
|
order,
|
|
282
285
|
};
|
|
283
286
|
|
|
@@ -33,6 +33,12 @@ function isScrollEnd() {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
function open(tab: TTab) {
|
|
37
|
+
if (props.current.path !== tab.path) {
|
|
38
|
+
emits('open', tab);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
function refresh(tab: TTab) {
|
|
37
43
|
if (!refreshAnim.value) {
|
|
38
44
|
refreshAnim.value = true;
|
|
@@ -51,7 +57,7 @@ useMutationObserver($tabList, isScrollEnd, { childList: true });
|
|
|
51
57
|
<div
|
|
52
58
|
v-for="tab of props.tabs" :key="tab.path"
|
|
53
59
|
class="tab" :class="{ opened: tab.path === props.current?.path }"
|
|
54
|
-
@click="
|
|
60
|
+
@click="open(tab)"
|
|
55
61
|
>
|
|
56
62
|
<span class="title">{{ tab.title }}</span>
|
|
57
63
|
<span v-if="tab.type !== 2 && props.tabs.length > 1" class="close-btn" @click.stop="emits('close', tab)">
|