u
This commit is contained in:
1 parent
d1b1aafc57
commit
0f1604c709
58 files changed
+15476
-25
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useRouter } from "vue-router";
|
||||
export const useRouterStore = defineStore("router", () => {
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const getCurrentPath = () => {
|
||||
return route.path;
|
||||
};
|
||||
const toPath = (path: string) => {
|
||||
router.push(path);
|
||||
};
|
||||
return {
|
||||
getCurrentPath,
|
||||
toPath,
|
||||
};
|
||||
});
|
||||
Reference in new issue
Block a user