一、点击分享按钮
二、获取到地址栏id
三、展现到页面
复制代码
一、点击事件 Vue点击事件@click javascript
ios
import QRCode from 'qrcode' //那使用哪用
// With promises
QRCode.toDataURL('I am a pony!')
.then(url => {
console.log(url)
})
.catch(err => {
console.error(err)
})
复制代码
六、点击事件的方法具体代码npm
// 点击分享
share() {
this.show = true;
let url = location.href;//获取当前地址栏的地址
console.log(url);
QRCode.toDataURL(url)
.then(tpian => {
console.log(tpian);
this.imrUrl = tpian;
})
.catch(err => {
console.error(err);
});
},
复制代码