query: {
key: 'value', // orderNum : this.searchData.orderNo
}
}">
2. $方式跳轉
this.$router.push({name:'路由命名',params:{參數名:參數值,參數名:參數值}})
this.$router.push({
path: 'yourPath',

name: '要跳轉的路徑的 name,在 router 文件夾下的 index.js 文件內找',
params: {
key: 'key',
msgKey: this.msg
}
/*query: {
key: 'key',
msgKey: this.msg
}*/

})
接受方式
this.$route.params.參數名
this.$route.query.參數名
實驗(包含兩種方式):
傳遞頁:
-----------------------------------------------------------------------------------------export default {

name: 'reads',
data () {
return {
msg: 'msg test.'
}
},
接收頁:
Num:{{ myIndex }}

{{ msg }}
-----------------------------------------------------------data () {
return {
msg: '',
// 保存傳遞過來的index
myIndex: ''
}-----------------------------------------------------------mounted: function () {
this.msg = this.$route.params.msgKeyOne this.myIndex = this.$route.params.msgKey
console.log(this.myIndex)
}
相關免費學習推薦:(視頻)