🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
不同路由之间传值:动态路由 1.配置动态路由 ``` routes:[ {path:'/user/:id',component:User} ] ``` 2.在对应的页面取参数的值 ``` this.$route.params 获取动态路由的值 post方式 this.$route.query get方式 ``` ***** ``` <ul> <li v-for="(item,key) in list"> <router-link :to="'/detail/'+key">{{key}}---{{item}}</router-link> </li> </ul> ``` 路由里: ``` { path: '/Detail/:aid', name: 'detail', component: Detail } ``` ***** ``` <ul> <li v-for="(item,key) in list"> <router-link :to="'/Pdetail/?aid='+key">{{key}}---{{item}}</router-link> </li> </ul> ``` 路由里 ``` { path: '/PDetail', name: 'Pdetail', component: PDetail }, ```