this.$router.push({
path: 'AddExam',
query: {
fee: JSON.stringify(res.data)
}
})
if (this.$route.query) {
this.fee = JSON.parse(this.$route.query.fee)
}
用query传递对象时,要把对象转化成字符串
接受对象时,要把字符串转化为对象
不然接收不到参数
this.$router.push({
path: 'AddExam',
query: {
fee: JSON.stringify(res.data)
}
})
if (this.$route.query) {
this.fee = JSON.parse(this.$route.query.fee)
}
用query传递对象时,要把对象转化成字符串
接受对象时,要把字符串转化为对象
不然接收不到参数