🔱: [client] sync upgrade with 7 commits [trident-sync]

chore:
Merge branch 'vben'

# Conflicts:
#	package.json
perf: antdv示例改成使用vben框架
chore: vben
chore: vben
chore: vben
This commit is contained in:
GitHub Actions Bot
2025-03-03 19:24:51 +00:00
parent de26ee9383
commit 335d175d57
649 changed files with 36984 additions and 826 deletions
@@ -0,0 +1,35 @@
import type { RouteRecordNormalized } from "vue-router";
import { useRouter } from "vue-router";
import { isHttpUrl, openRouteInNewWindow, openWindow } from "../../../utils";
function useNavigation() {
const router = useRouter();
const routes = router.getRoutes();
const routeMetaMap = new Map<string, RouteRecordNormalized>();
routes.forEach((route) => {
routeMetaMap.set(route.path, route);
});
const navigation = async (path: string) => {
const route = routeMetaMap.get(path);
const { openInNewWindow = false, query = {} as any } = route?.meta ?? {};
if (isHttpUrl(path)) {
openWindow(path, { target: "_blank" });
} else if (openInNewWindow) {
openRouteInNewWindow(path);
} else {
await router.push({
path,
query
});
}
};
return { navigation };
}
export { useNavigation };