import { onMounted } from 'vue'
import { useRouter } from 'vue-router'
export default {
setup() {
const $router = useRouter()
onMounted(()=>{
//当前路由路径名称
console.log($router.currentRoute._rawValue.path)
})
return{}
}
vue3获取当前路由的路径名
最新推荐文章于 2024-04-16 11:08:36 发布