zoukankan      html  css  js  c++  java
  • vue 与qrcodejs2 生成的二维码 logo 居中

     代码:
    <div class="qrcode" >
          <img src="图片地址" v-if="iconIMGurl==='0'?false:true"  class="logoimg"/>
          <div ref="qrcode" id="qrcode">
          </div>
        </div>
     
     
    style:
    .qrcode{
      display:inline-block;
      position:relative;margin-top: .2rem;
    }
    .logoimg{
        position:absolute;
        left:50%;
        top:50%;
        60px;
        height:60px;
        margin-top:-30px;
        margin-left:-30px;
    }
     
     
    js:
    import QRcode from 'qrcodejs2'   //引入
    qrcode() {
          this.qrcode = new QRcode('qrcode', {
             200, // 设置宽度,单位像素
            height: 200, // 设置高度,单位像素
            text: this.QRtext, // 设置二维码内容或跳转地址
            colorDark: this.erweiCodeColor // 二维码的颜色
          })
        }
     
  • 相关阅读:
    基本运算符
    格式化输出
    Python与用户的交互
    数据类型
    变量
    正则表达式
    vuex方法
    vue的webpack打包步骤
    浮动问题
    媒体查询技术
  • 原文地址:https://www.cnblogs.com/wz2018/p/13614725.html
Copyright © 2011-2022 走看看