fix(UI): back root page for rail bar on tablet
This commit is contained in:
@@ -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 边距 ----------
|
||||
|
||||
Reference in New Issue
Block a user