Socket
Socket
Sign inDemoInstall

rax-barcode

Package Overview
Dependencies
Maintainers
5
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rax-barcode

barcode component for Rax.


Version published
Maintainers
5
Created
Source

npm

描述:

Barcode 用于显示条形码,基于 Canvas 实现

安装

$ npm install rax-barcode --save

引用

import Barcode from "rax-barcode";

属性

注:

  1. 支持列表中的 browser代表 h5 weex代表 weex miniApp代表阿里小程序 wechatMiniprogram 代表微信小程序

  2. 支持目前仅支持: CODE39,CODE128, CODE128A, CODE128B, CODE128C

  3. options 除列出参数外,其余参数请参考 https://github.com/lindell/JsBarcode

属性类型默认值必填描述支持
datastring-✔️数据browserweexminiAppwechatMiniprogram
typestringCODE128类型browserweexminiAppwechatMiniprogram
styleobject{width:500,height:200}样式browserweexminiAppwechatMiniprogram
optionobject-参数browserweexminiAppwechatMiniprogram

options 详解

属性类型默认值必填描述
barWidthnumber2单个条码的宽度
fillColorstring-数据块填充色

示例

import { createElement, render, Component } from "rax";
import DriverUniversal from "driver-universal";
import View from "rax-view";
import BarCode from "rax-barcode";

class App extends Component {
  constructor() {
    super();
  }

  render() {
    return (
      <View style={{ flex: 1 }}>
        <BarCode
          data={"123456789"}
          options={{
            fillColor: "red"
          }}
        />
      </View>
    );
  }
}

render(<App />, document.body, { driver: DriverUniversal });

Keywords

FAQs

Package last updated on 16 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc