You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
744 B

1 year ago
  1. # qrcode-base64
  2. Generating the QR code in the form of Base64
  3. 微信小程序生成二维码的插件,基于base64编码输出二维码,不依赖canvas,理论支持全平台
  4. >PS: 主要在`node-yaqrcode`项目基础上进行改造适应微信小程序
  5. ## 说明
  6. 使用NPM
  7. ```
  8. npm install qrcode-base64
  9. ```
  10. JS调用例子:
  11. ```
  12. import QR from 'qrcode-base64'
  13. var imgData = QR.drawImg(this.data.codeText, {
  14. typeNumber: 4,
  15. errorCorrectLevel: 'M',
  16. size: 500
  17. })
  18. // 返回输出base64编码imgData
  19. ```
  20. ## DEMO示例图
  21. ![demo-img](https://github.com/Pudon/weapp-qrcode-base64/blob/master/demo/demo.png?raw=true)
  22. ## TODO
  23. 1. 更多配置项,灵活多样
  24. 2. 样式自定义化,增加更丰富的样式