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)
}

posted on 2020-05-04 22:48  心意如水hucuie22  阅读(137)  评论(0编辑  收藏  举报