Giter Site home page Giter Site logo

qrcode's Introduction

qrcode_quickapp

快应用中生成二维码,依赖快应用的canvas组件

使用方式

  1. 引入 dist 目录中 qrcode.js

    import qrcode from 'qrcode.js'; 
  2. 在页面中需要生成二维码位置创建 canvas 组件,并设置id

    <canvas id="qrcode"></canvas>
  3. 调用 qrcode(options: object) 方法

    qrcode({
      text: "https://doc.quickapp.cn/", // 需要生成的二维码字符串
    },this.$element('qrcode'))

    options 参数说明:

    参数 类型 默认值 含义
    text string "" 要编码的字符串
    width number 300 二维码的宽,单位是px
    height number 300 二维码的高,单位是px
    correctLevel number 3 纠错级别,可取0、1、2、3,数字越大说明所需纠错级别越大x
    background color #FFFFFF 背景色
    foreground color #000000 前景色
    pdground color #000000 三个角的颜色
    image string "" 二维码中间logo的url
    imageSize number 30 二维码中间logo的大小

示例

示例参见 example 文件夹快应用项目Demo页面

源代码参见 src 文件夹

效果:

qrcode's People

Contributors

sehuo avatar afc163 avatar wangcao avatar meowtec avatar sorrycc avatar army8735 avatar lifesinger avatar littlebeat avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.