vue router 带参数转码
2018-11-16 本文已影响0人
_嘿嘿_
-
path: 'info/:cinfo',
-
//传递
let info = {
"userId":"mashroom",
"name":"大可"
}
var str =JSON.stringify(info);
var path = "/content/info/"+str;
this.route);
const cinfo = this.$route.params.cinfo;
let info = JSON.parse(decodeURI(cinfo));
console.log(info);
alert(info.name)