安装:

npm install --save qrcode

引入:

import QRCode from 'qrcode'

使用;

//触发事件调用下面的方法
// With promises
QRCode.toDataURL('http://jd.com/')
  .then(url => {
    console.log(url)
    this.imrUrl=url;
  })
  .catch(err => {
    console.error(err)
  })

 img使用:

<img v-if="qrcodeUrl" :src="qrcodeUrl" alt="">

 

.

 

 

 

 

 

 

 

 

相关文章:

  • 2021-10-30
  • 2021-10-18
  • 2022-12-23
  • 2022-02-11
  • 2021-12-09
  • 2021-11-21
  • 2021-11-21
猜你喜欢
  • 2022-12-23
  • 2021-11-27
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
相关资源
相似解决方案