diff --git a/vmall/react-native-qrcode-svg.md b/vmall/react-native-qrcode-svg.md new file mode 100644 index 0000000000000000000000000000000000000000..f0e07cf10e096e03a032b76e2a020b82b251dcd4 --- /dev/null +++ b/vmall/react-native-qrcode-svg.md @@ -0,0 +1,89 @@ +> 模板版本:v0.1.1 + +

+

react-native-qrcode-svg

+

+

+ + Supported platforms + + + License + +

+ +> [!tip] [Github 地址](https://github.com/react-native-oh-library/react-native-qrcode-svg) + +## 安装与使用 + +进入到工程目录并输入以下命令: + +```bash +yarn add @react-native-oh-tpl/react-native-qrcode-svg +``` + +或者 + +```bash +npm install @react-native-oh-tpl/react-native-qrcode-svg +``` + +下面的代码展示了这个库的基本使用场景: + +```js +import QRCode from 'react-native-qrcode-svg'; + +// Simple usage, defaults for all but the value +render() { + return ( + + ); +}; +``` + +## Link + +本库鸿蒙侧实现依赖@react-native-oh-tpl/react-native-svg 的原生端代码,如已在鸿蒙工程中引入过该库,则无需再次引入,可跳过本章节步骤,直接使用。 + +如未引入请参照[@react-native-oh-tpl/react-native-svg 文档的 Link 章节](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-svg.md#link)进行引入 + +## 约束与限制 + +### 兼容性 + +要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 + +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[ @react-native-oh-tpl/react-native-qrcode-svg Releases](https://github.com/react-native-oh-library/react-native-qrcode-svg/releases) + +## 属性 + +| 名称 | 说明 | 类型 | 是否必填 | 原库平台 | 鸿蒙支持 | +| ---------------------- | ------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | -------- | ------------------ | +| `size` | Size of rendered image in pixels | number | No | All | yes 不支持动态更新 | +| `value` | String Value of the QR code | string | yes | All | yes | +| `color` | Color of the QR code | string | No | All | yes | +| `backgroundColor` | Color of the background | string | No | All | yes | +| `enableLinearGradient` | enables or disables linear gradient | boolean | No | All | no | +| `linearGradient` | array of 2 rgb colors used to create the linear gradient | string[] | No | All | no | +| `gradientDirection` | the direction of the linear gradient | string | No | All | no | +| `logo` | Image source object. Ex. {uri: 'base64string'} or {require('pathToImage')} | object | No | All | yes | +| `logoSize` | Size of the imprinted logo. Bigger logo = less error correction in QR code | number | No | All | yes | +| `logoBackgroundColor` | The logo gets a filled quadratic background with this color. Use 'transparent' if your logo already has its own backdrop. | string | No | All | yes | +| `logoMargin` | logo's distance to its wrapper | number | No | All | yes | +| `logoBorderRadius` | the border-radius of logo image (Android is not supported) | number | No | ios | no | +| `quietZone` | quiet zone around the qr in pixels (useful when saving image to gallery) | number | No | All | yes 不支持动态更新 | +| `getRef` | Get SVG ref for further usage | callback | No | All | 不涉及 | +| `ecl` | Error correction level | string | No | All | yes | +| `onError(error)` | Callback fired when exception happened during the code generating process | callback | No | All | 不涉及 | + +## 遗留问题 + +- [ ] size、quietZone 属性暂不支持动态更新 + +## 其他 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/awesomejerry/react-native-qrcode-svg/blob/master/LICENSE) ,请自由地享受和参与开源。