您的位置:首页 > Web前端 > Vue.js

我的vue.js学习之路(vue中router-link传参以及参数的使用)

2018-09-26 12:03 507 查看

方法一:

<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

阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: