更新记录
0.0.4(2025-05-24)
- feat: 兼容uniapp x 鸿蒙next
0.0.3(2025-01-17)
- feat: 兼容hbx4.45
0.0.2(2024-01-19)
- chore: 更新文档
平台兼容性
uni-app x
Chrome | Safari | Android | iOS | 鸿蒙 | 微信小程序 |
---|---|---|---|---|---|
- | - | 5.0 | 12 | - | - |
lime-barcodegen UTS API
- 配合 lime-barcode uvue 组件使用的
安装
导入本插件后要自定义基座才能运行
基本使用
<view ref="barcodeRef"></view>
import { renderer, LBarcodeGenOptions } from '@/uni_modules/lime-barcodegen';
const el = this.$refs['barcodeRef'] as UniElement
renderer(el, this.text, {
format?: string, //条形码类型,目前仅支持 EAN13、CODE39、CODE128、codabar
textPosition?: string,// 文本对齐方式
lineColor?:string, // 线条颜色
width?: number,// 线条宽度
height?: number,// 线条长度
textMargin?: number
fontSize?: number
margin?: number
marginTop?: number
marginBottom?: number
marginLeft?: number
marginRight?: number
} as LBarcodeGenOptions)