Skip to content

基于qrcode.js的Taro库,在Taro中生成二维码

Notifications You must be signed in to change notification settings

xueyida/QRcode.taro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

QRCode.Taro

Taro 二维码组件,根据QRcode.js封装(版本为1.2.4,可能不能兼容之后的版本)

安装

  
  npm install qrcode.taro -S
  
  yarn add qrcode.taro -S

API

props

参数 说明 类型 默认值
renderAs 渲染类型 canvas | svg canvas
value 生成二维码码的内容 sring test
size 生成二维码的尺寸 number 128
bgColor 二维码背景颜色 string #fff
fgColor 二维码前景颜色 string #000

使用

使用的文件

  
  import QRcode from 'qrcode.taro'

  const App = () => (
    <>
      <QRcode />
    </>
  );

修改 config/index.js

  const config = {
    ...
    h5: {
      ...
      esnextModules: ['qrcode.taro'],
    },
  }

注意事项

使用前请确保项目中已经安装了Taro相关的库,主要有如下:

  • @tarojs/taro

  • nervjs

  • @tarojs/components

  • qr.js

About

基于qrcode.js的Taro库,在Taro中生成二维码

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published