新增
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import type { RouteLocationNormalizedLoaded } from 'vue-router'
|
||||
|
||||
export function useWatchRoute(callback: (route: RouteLocationNormalizedLoaded) => void) {
|
||||
const route = useRoute()
|
||||
watch(
|
||||
route,
|
||||
() => {
|
||||
callback(route)
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
return {
|
||||
route
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user