标签:port import 路由 one 一个 参数传递 不能 class router
1.路由跳转
export default new VR({ routes:[ { path:"/hello", name:"HelloWorld", component:HelloWorld }, { path:"/learn", name:"Learn", component:Learn } ] })
4.在需要切换的地方使用标签router-link
<ul> <router-link tag="li" to="hello"> hello</router-link> <router-link to="learn"> learn</router-link> </ul>
属性:
2.动态路由(参数传递)
/:id 多个参数就 /:id/:name
3.路由嵌套
01.引入子路由后
02.在创建路由时,添加一个children ,多级嵌套就添加多个children
export default new VR({ routes:[ { path:"/hello", name:"HelloWorld", component:HelloWorld }, { path:"/learn", name:"Learn", component:Learn, children:[ { path:"base", component:Base } ] } ] })
03跳转的地方:to="/Learn/Base"这个要写全,不能只写Base
<router-link tag="li" to="/Learn/Base"> Base </router-link>
标签:port import 路由 one 一个 参数传递 不能 class router
原文地址:https://www.cnblogs.com/somethingWithiOS/p/11185062.html