<router-link :to="{path:'Index2',query:{id:1}}"> path-query </router-link>
<router-link :to="{name:'Index2',query:{id:1}}"> name-query </router-link>
this.$route.query方式接收参数<router-link :to="{path:'Index2',params:{id:2}}"> path-params </router-link>
1、this.$route.params接收不到参数<router-link :to="{name:'Index2',params:{id:2}}"> name-params </router-link>
2、this.$route.params接收参数,页面刷新后接收不到参数
热门推荐:
0