fix(UI): back root page for rail bar on tablet

This commit is contained in:
Timi
2026-11-14 17:05:54 +08:00
parent 0910d8dc40
commit 6b7346f029
3 changed files with 17 additions and 8 deletions
+11 -2
View File
@@ -7,6 +7,7 @@
tab-bar-float
:hide-nav="!tabBarStore.isShowing"
@change="onChangeTab"
@rail-click="onRailClick"
>
<template #rail-extra>
<t-button
@@ -174,11 +175,19 @@ function resolveVisibleTabValue(path: string): string {
function onChangeTab(value: string | number): void {
const path = String(value);
if (resolveTabValue(route.path) === path) {
if ((railVisible.value ? route.path : resolveTabValue(route.path)) === path) {
return;
}
router.push(path);
void router.push(path);
}
/** 再次点击已激活的侧栏导航时返回栏目根页面。 */
function onRailClick(value: string | number): void {
const path = String(value);
if (path === tabVal.value && route.path !== path) {
void router.push(path);
}
}
// ---------- Tab 边距 ----------