Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gem-mine/rc-qrcode
react的二维码组件
https://github.com/gem-mine/rc-qrcode
Last synced: about 1 month ago
JSON representation
react的二维码组件
- Host: GitHub
- URL: https://github.com/gem-mine/rc-qrcode
- Owner: gem-mine
- Created: 2019-09-18T07:27:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-08T13:57:50.000Z (over 2 years ago)
- Last Synced: 2024-04-13T19:06:05.709Z (9 months ago)
- Language: JavaScript
- Homepage: https://gem-mine.github.io/rc-qrcode/site/
- Size: 1.35 MB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# rc-qrcode
---二维码组件,用于绘制二维码
## Usage
```js
import Qrcode from '@gem-mine/rc-qrcode';
import React from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(, container);
```### 基本使用
基本使用
```jsx
import Qrcode from "@gem-mine/rc-qrcode";class Demo extends React.Component {
constructor(props) {
super(props);
}render() {
let _p = {
text: '2017.03.29',
};
return (
);
}
}
ReactDOM.render(, mountNode);
```### 二维码图案
二维码图案
```jsx
import Qrcode from "@gem-mine/rc-qrcode";class Demo extends React.Component {
constructor(props) {
super(props);
}render() {
let _p = {
text: '2017.12.05',
image: '//cs.101.com/v0.1/static/fish/image/11.png?serviceName=fish',
};
return (
);
}
}ReactDOM.render(, mountNode);
```## API
| 参数 | 说明 | 类型 | 默认值 |
|-|-|-|-|
| size | 必选参数,二维码大小 | Number | 256 |
| text | 必选参数,要编码的字符串 | String | '' |
| correctLevel | 纠错级别,可取0、1、2、3,数字越大说明所需纠错级别越大 | Number | 3 |
| background | 背景色 | String | '#fff' |
| foreground | 前景色 | String |'#000' |
| image | 中间图片的url,只支持配置正方形图片 | String | '' |
| imageSize | 中间图片的大小 | Number | 3 |## License
rc-qrcode is released under the MIT license.