520BigBear

安装:

npm install qrcodejs2 --save
或者 淘宝镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org  再
cnpm install qrcodejs2 --save

引入:

<script>
import QRCode from \'qrcodejs2\'
export default {
    data () {
        return {
           
        }
    },
    created () {
        this.$nextTick(function () {
            this.bindQRCode();
        })
    },
    methods: {
        bindQRCode: function () {new QRCode(this.$refs.qrCodeDiv, {
                text: \'www.baidu.com\',
                width: 200,
                height: 200,
                colorDark: "#333333", //二维码颜色
                colorLight: "#ffffff", //二维码背景色
                correctLevel: QRCode.CorrectLevel.L//容错率,L/M/H
            })
      }
    }
}
</script>

效果图:

 

 

参考链接:https://www.cnblogs.com/ajuan/p/10100931.html

https://www.baidu.com

分类:

技术点:

相关文章:

  • 2021-12-09
  • 2020-06-18
  • 2021-11-17
  • 2021-12-19
  • 2021-12-09
  • 2021-10-02
  • 2021-11-06
  • 2021-10-02
猜你喜欢
  • 2022-01-13
  • 2021-11-07
  • 2021-12-23
  • 2021-11-10
  • 2021-09-13
  • 2021-11-07
  • 2021-06-08
相关资源
相似解决方案