1、根据Url传参方式
this.qrcodeShare=true this.$nextTick(()=>{ let qrCodeContainer = document.getElementById(‘qrcode‘); qrCodeContainer.innerHTML = ‘‘; let qrcode = new QRCode(qrCodeContainer, { width: 200,//设置宽高 height: 200 }); qrcode.makeCode(‘url?aa=‘+this.aa+‘&bb=‘+this.bb);
js接收:this.aa=this.$route.params.aa
2、根据路由配置
例如:"url/:aa/:bb/:cc" 页面url为 http://XXX.com/ms/11/22/33
js接收:this.aa=this.$route.query.aa