u
This commit is contained in:
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
|
||||
};
|
||||
});
|
||||
Reference in new issue
Block a user