From b0e57b83110120700a15bfa07414b4f70066cbee Mon Sep 17 00:00:00 2001 From: severnking <2523913042@qq.com> Date: Fri, 12 Jul 2024 19:56:36 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[Issues:#IABHFV]=20=E6=96=B0=E5=A2=9Ere?= =?UTF-8?q?act-native-easy-grid=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/react-native-easy-grid.md | 189 ++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 zh-cn/react-native-easy-grid.md diff --git a/zh-cn/react-native-easy-grid.md b/zh-cn/react-native-easy-grid.md new file mode 100644 index 00000000..8282b7e1 --- /dev/null +++ b/zh-cn/react-native-easy-grid.md @@ -0,0 +1,189 @@ + + +> 模板版本:v0.2.2 + +

+

react-native-share

+

+

+ + Supported platforms + + + License + +

+ +> [!TIP] [Github 地址](https://github.com/GeekyAnts/react-native-easy-grid) + + +## 安装与使用 + +进入到工程目录并输入以下命令: + +#### **npm** + +```bash +npm install react-native-easy-grid@0.2.2 --save +``` + +#### **yarn** + +```bash +yarn add react-native-easy-grid@0.2.2 +``` + + + +#### **导入组件** + +```js + +import { Col, Row, Grid } from "react-native-easy-grid"; + +``` + +下面的代码展示了这个库的基本使用场景: + +> [!WARNING] 使用时 import 的库名不变。 + + +1. 两列等宽(50% and 50%)布局 + +```js + +import { Col, Row, Grid } from "react-native-easy-grid"; + + + + + + +``` +![](./images/image.png) +2.两行等高(50% and 50%)布局 + +```js + + + + + + + +``` +![](./images/1720267666464_image.png) +3. 两行占比(75% and 25%)布局 + +```js + + + + + + +``` +![](./images/1720267680344_image.png) +4.三列占比(33.33%)布局 + +```js + + + + + + + +``` +![](./images/1720420862660_image.png) +5.嵌套布局 + +```js + + + 1 + + + + 2 + + + 3 + + + + +``` +![](./images/1720267731010_image.png) +6.固定宽度和动态宽度组合 + +```js + + + Fixed width + + + Fluid width + + + +``` +![](./images/1720267758935_image.png) +7.固定高度和动态高度组合 + +```js + + + Fixed width + + + Fluid width + + + +``` +![](./images/1720267901501_image.png) + +## 约束与限制 + +##### 兼容性 +本文档内容基于以下版本验证通过: +RNOH: 0.72.27; SDK: HarmonyOS-NEXT Developer Beta1; IDE: DevEco Studio 5.0.3.400SP7; ROM: 3.0.0.25; + +## 组件 + +> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 + +> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 + +| Name | Description | Type | Required | Platform | HarmonyOS Support | +| ---- | ----------- | ---- | -------- | -------- | ------------------ | +| Grid | 网格组件 | Component | yes | iOS,Android | yes | +| Col | 列块组件 | Component | yes | iOS,Android | yes | +| Row | 行块组件 | Component | yes | iOS,Android | yes | + + +## 属性、方法 + +> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 + +> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 + +| Name | Description | Type | Required | Platform | HarmonyOS Support | +| ---- | ----------- | ---- | -------- | -------- | ------------------ | +| style |组件CSS样式 | Object | yes | iOS,Android | no | +| size |组件布局占比 | number | no | iOS,Android | yes | +| onPress:() => void |点击事件 | function | no | iOS,Android | yes | + + + +## 遗留问题 + +## 其他 +注意:如果你在ScrollView 中使用Row ,那么组件的高度会根据内容灵活变化,尽管你总是可以应用高度样式。 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/GeekyAnts/react-native-easy-grid/blob/master/LICENSE) ,请自由地享受和参与开源。 + + -- Gitee