如何做到下面这两种方式
--------编程式导航-----
router.push({ name: 'user', params: { userId: 123 }})
// 带查询参数,变成 /register?plan=private
router.push({ path: 'register', query: { plan: 'private' }})
---------导航守卫---------------------
const router = new VueRouter({ ... })
router.beforeEach((to, from, next) => {
// ...
})
=========================
慕侠2389804