mirror of
https://github.com/certd/certd.git
synced 2026-05-15 04:27:31 +08:00
perf: 首页证书数量支持点击跳转
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import type { RouteRecordNormalized } from "vue-router";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { isHttpUrl, openRouteInNewWindow, openWindow } from "../../../utils";
|
||||
|
||||
function useNavigation() {
|
||||
const router = useRouter();
|
||||
const route1 = useRoute();
|
||||
const routes = router.getRoutes();
|
||||
|
||||
const routeMetaMap = new Map<string, RouteRecordNormalized>();
|
||||
@@ -15,6 +16,9 @@ function useNavigation() {
|
||||
});
|
||||
|
||||
const navigation = async (path: string) => {
|
||||
if (route1.path === path) {
|
||||
return;
|
||||
}
|
||||
const route = routeMetaMap.get(path);
|
||||
const { openInNewWindow = false, query = {} as any } = route?.meta ?? {};
|
||||
if (isHttpUrl(path)) {
|
||||
|
||||
Reference in New Issue
Block a user