描述:
Barcode 用于显示条形码,基于 Canvas 实现
安装
$ npm install rax-barcode --save
引用
import Barcode from "rax-barcode";
属性
注:
-
支持列表中的 代表 h5 代表 weex 代表阿里小程序 代表微信小程序
-
支持目前仅支持: CODE39,CODE128, CODE128A, CODE128B, CODE128C
-
options 除列出参数外,其余参数请参考 https://github.com/lindell/JsBarcode
属性 | 类型 | 默认值 | 必填 | 描述 | 支持 |
---|---|---|---|---|---|
data | string |
- | ✔️ | 数据 | |
type | string |
CODE128 | ✘ | 类型 | |
style | object |
{width:500,height:200} | ✘ | 样式 | |
option | object |
- | ✘ | 参数 |
options 详解
属性 | 类型 | 默认值 | 必填 | 描述 |
---|---|---|---|---|
barWidth | number |
2 | ✘ | 单个条码的宽度 |
fillColor | string |
- | ✘ | 数据块填充色 |
示例
;;;; { super; } { return <View style= flex: 1 > <BarCode data="123456789" options= fillColor: "red" /> </View> ; } ;