index.js路由规则设定:
/searchResult/syyName=:syyName
发送页面:
//传参页面
this.$router.push({name: 'SearchResult', params: {syyName: this.searchVal, syyType: this.searchQuesTitle}})
接收页面:
//接参页面
// 对接钩子参数
var sname = this.$route.params.syyName;
var stype = this.$route.params.syyType;
console.log(sname+'/'+stype);
this.searchVal = this.$route.params.syyName;
案例提示:
博主自留言:对应搜索页和搜索结果页(如截图)
以上就是关于“ vue页面传参(多个参数传值)与接参 - 代码篇” 的全部内容。