main.js 设置路由的路径path:"/edit/:id"
<router-link v-bind:to="‘/edit/‘+data.id">编辑</router-link>
load:function(id){
console.log(id)
this.$http.get("http://jsonplaceholder.typicode.com/users/"+id).
then(function(data){
this. customes=data.body
})
}
},
created(){
this.submits();
this.load(this.$route.params.id)
}
原文:https://www.cnblogs.com/xzhce/p/12828667.html