vue向路由组件传递props

参考vue-router官网

别的组件中跳转到目标组件:

route

注意这里路由跳转的时候需要使用name,而不是path,path跳转之后,props属性userType的值为undefined

路由中声名:

route

组件中声名:

route