vue页面传参数

1.params方法

a页面

this.$router.push({path:`/addressEdit/${item.id}`})

b页面接收:

created(){

console.log(this.$route.params.id)

}

2. query方法

a页面

this.$router.push({

path: path: `/addressEdit/${item.id}`, 

query: {

searchVal: "1" ,

},

});

b页面接收:

created(){

this.$route.query.searchVal

}

posted @ 2021-04-15 16:39  阿杰啊啊  阅读(218)  评论(0)    收藏  举报