<div class="poster-qr">
<div class="qrWrapper">
<!-- 放置二维码的容器 -->
<div id="qrcode" ref="qrcode" class="qrcode"/>
</div>
<div class="qrDesc">长按扫描二维码领取</div>
</div>

  

import QRCode from 'qrcodejs2'
export default {
name: 'SharePoster',
components: { QRCode },
data() {
return {}
},
mounted() {
this.$nextTick(() => {
this.qrcode('http://www.baidu.com') // 二维码的内容,由后端返回链接
})
},
methods: {
// 生成二维码
qrcode(url) {
new QRCode(window.document.getElementById('qrcode'), {
width: window.document.getElementById('qrcode').offsetWidth,
height: window.document.getElementById('qrcode').offsetHeight,
text: url,
     colorDark: '#000',
colorLight: '#fff',
correctLevel: QRCode.CorrectLevel.H
})
    }
}

  

最新文章

  1. linux服务器使用
  2. mac 设置 git 和github 告别命令行
  3. 关于SQLSERVER联合查询一点看法
  4. XML转换为对象操作类详解
  5. http://www.roncoo.com/article/detail/124822
  6. 关于Java中的程序,进程和线程的详解...
  7. poj3368Frequent values(RMQ)
  8. css-position的相关用法
  9. ortp使用详解1
  10. 20170717_python爬虫之requests+cookie模拟登陆
  11. 更为复杂C程序的运行时结构
  12. odoo开发笔记 -- 模型字段定义中设置默认值
  13. Winform实现多线程异步更新UI(进度及状态信息)
  14. Django(十)COOKIE和session
  15. Qt__绘制系统
  16. container_of使用小结
  17. 如何通过DataGridView 实现单元格合并和二维表头
  18. [控件] TranformFadeView
  19. flask的第一个例子
  20. Node JVM

热门文章

  1. vue接口
  2. 在mysql中正常查询的句子,在C#中出错,原因是定义了变量。
  3. c 理解
  4. 枚举类list序列化与反序列化
  5. win10 wampserver升级 php7.0至 php7.2
  6. Javaheima21
  7. cpu的调度
  8. JSqlParser解析SQL时SUM包裹IF出错
  9. ffmpeg gcc is unable to create an executable file C compiler test failed
  10. mysql 中 insert 大量数据 避免时间戳相同 !!