美文网首页
vue router 带参数转码

vue router 带参数转码

作者: _嘿嘿_ | 来源:发表于2018-11-16 12:27 被阅读0次
    1. path: 'info/:cinfo',

    2. //传递
      let info = {
      "userId":"mashroom",
      "name":"大可"
      }
      var str =JSON.stringify(info);
      var path = "/content/info/"+str;
      this.router.push(encodeURI(path)); 3.//获取 console.log(this.route);
      const cinfo = this.$route.params.cinfo;
      let info = JSON.parse(decodeURI(cinfo));
      console.log(info);
      alert(info.name)

    相关文章

      网友评论

          本文标题:vue router 带参数转码

          本文链接:https://www.haomeiwen.com/subject/sexmfqtx.html