code refactor

This commit is contained in:
MaysWind
2025-01-16 21:35:56 +08:00
parent 3a50e6d2de
commit adebc96637
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -82,8 +82,8 @@ const pushRouter = (tab: string) => {
};
onBeforeRouteUpdate((to) => {
if (to.query && to.query.tab && ALL_TABS.indexOf(to.query.tab) >= 0) {
activeTab.value = to.query.tab;
if (to.query && to.query['tab'] && ALL_TABS.indexOf(to.query['tab'] as string) >= 0) {
activeTab.value = to.query['tab'] as string;
} else {
activeTab.value = 'basicSetting';
}
+2 -2
View File
@@ -98,8 +98,8 @@ const pushRouter = (tab: string) => {
};
onBeforeRouteUpdate((to) => {
if (to.query && to.query.tab && ALL_TABS.indexOf(to.query.tab) >= 0) {
activeTab.value = to.query.tab;
if (to.query && to.query['tab'] && ALL_TABS.indexOf(to.query['tab'] as string) >= 0) {
activeTab.value = to.query['tab'] as string;
} else {
activeTab.value = 'basicSetting';
}