方法一:
<router-link :to="'/index/'+id">
路径是:http://localhost:8080/#/index/1
如果想使用参数,this.$route.params.id
方法二:
<router-link :to="{path:'/index',query: {name: id}}">
路径是:http://localhost:8080/#/index?name=1
如果想使用参数,this.$route.query.id
<router-link :to="'/index/'+id">
路径是:http://localhost:8080/#/index/1
如果想使用参数,this.$route.params.id
<router-link :to="{path:'/index',query: {name: id}}">
路径是:http://localhost:8080/#/index?name=1
如果想使用参数,this.$route.query.id