Naughty Pterodactyl Maid

    rax-qrcode
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.2 • Public • Published

    rax-qrcode

    npm

    描述

    QRCode 是一个用于生成二维码的 Rax 组件

    安装

    $ npm install rax-qrcode --save

    属性

    属性 类型 默认值 必填 描述 支持
    data string - ✔️ 二维码承载的数据内容 browser weex miniAppwechatMiniprogram
    style object - 自定义样式 browser weex miniAppwechatMiniprogram
    options object - 二维码生成器配置项 browser weex miniAppwechatMiniprogram

    options 详解

    属性 类型 默认值 必填 描述
    errorCorrectLevel string 'H' 容错级别,可设置为:'L''M''Q''H'
    typeNumber number 1 二维码计算模式
    blankColor string '#000000' 空白处颜色
    fillColor string '#ffffff' 数据块填充色

    示例

    import { createElement, render } from "rax";
    import DriverUniversal from "driver-universal";
    import View from "rax-view";
    import QRCode from "rax-qrcode";
    
    function App() {
      return (
        <View style={{ flex: 1 }}>
          <QRCode
            data="http://market.m.taobao.com/apps/market/m-vip/88-festival.html?wh_weex=true&wx_navbar_transparent=true"
            style={{ width: 400, height: 400 }}
          />
          <QRCode
            data="http://market.m.taobao.com/apps/market/m-vip/88-festival.html?wh_weex=true&wx_navbar_transparent=true"
            options={{ fillColor: "red", blankColor: "#000", errorCorrectLevel: 'L' }}
          />
        </View>
      );
    }
    
    render(<App />, document.body, { driver: DriverUniversal });

    Install

    npm i rax-qrcode

    DownloadsWeekly Downloads

    11

    Version

    2.0.2

    License

    BSD-3-Clause

    Unpacked Size

    29.7 kB

    Total Files

    21

    Last publish

    Collaborators

    • zeroling
    • rax-publisher