在plugins
新建route.js
文件
export default ({
app
}) => {
app.router.beforeEach((to, from, next) => {
next()
console.log(to)
})
}
在nuxt.config.js
配置
plugins: [
'@/plugins/route'
],
在plugins
新建route.js
文件
export default ({
app
}) => {
app.router.beforeEach((to, from, next) => {
next()
console.log(to)
})
}
在nuxt.config.js
配置
plugins: [
'@/plugins/route'
],