vue router 带参数转码

  1. path: 'info/:cinfo',

  2. //传递
    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)

你可能感兴趣的:(vue router 带参数转码)