【发布时间】:2021-05-19 05:19:00
【问题描述】:
我正在尝试切换到 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-requests?
【问题讨论】:
-
嗨 RajkumarG,是的,我做到了。而且我没有在 setup-method 中看到像 beforeRouteEnter-guard 一样应用的方法。也许这不是一个概念?
标签: vue.js vue-router vuejs3 vue-router4