This commit is contained in:
oneao committed 2025-06-18 16:30:01 +08:00
1 parent bcc4722efc
commit f48536774f
403 files changed
+34776

No files matched your search

@@ -0,0 +1,18 @@
import { defineStore } from "pinia";
import { useRoute } from "vue-router";
import { RouteLocationRaw, useRouter } from "vue-router";
export const useRouterStore = defineStore("router", () => {
const route = useRoute();
const router = useRouter();
const getCurrentPath = () => {
return route.path;
};
const toPath = (params: RouteLocationRaw) => {
router.push(params);
};
return {
getCurrentPath,
toPath
};
});