我正在尝试切换到 vuejs3 和新的 vue-router。
现在我看到 beforeRouteEnter 没有暴露:
// same as beforeRouteUpdate option with no access to `this`
onBeforeRouteUpdate((to, from, next) => {
// your logic
console.log("Hello world") //this is only triggered if the id changes
next()
})
所以我的问题是:如何像/dashboard
以前一样在特定路线上触发初始 axios 请求?