Files
ClassContent/历届学生/front-end-team-11/项目开发/学生项目/冯文焌/fontend/src/utils/router.ts
2024-09-27 02:06:13 +08:00

25 lines
455 B
TypeScript

import { useRouter, RouteLocationRaw, useRoute } from 'vue-router'
export function useRouterAction() {
const router = useRouter()
function push(to: RouteLocationRaw){
router.push(to)
}
function replace(to: RouteLocationRaw){
router.replace(to)
}
function back(){
router.back()
}
function route() {
return useRoute()
}
return {
push, replace, route, router, back
}
}