From 002bd7c32c8b15ad5ba191f68fe9721e2b0bc005 Mon Sep 17 00:00:00 2001 From: severnking <2523913042@qq.com> Date: Mon, 8 Jul 2024 21:40:17 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[#IABHFV]=E6=96=B0=E5=A2=9Ereact-native?= =?UTF-8?q?-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 | 196 ++++++++++++++++++++++++++++++++ 1 file changed, 196 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..2e031778 --- /dev/null +++ b/zh-cn/react-native-easy-grid.md @@ -0,0 +1,196 @@ + + + +> 模板版本:v0.2.2 + +

+

react-native-share

+

+

+ + Supported platforms + + + License + +

+ +> [!TIP] [Github 地址](https://github.com/GeekyAnts/react-native-easy-grid.git) + + +## 安装与使用 + +请到三方库的 Releases 发布地址查看配套的版本信息:[react-native-easy-grid Releases](https://github.com/GeekyAnts/react-native-easy-grid/releases),并下载适用版本的 tgz 包。 + +进入到工程目录并输入以下命令: + +> [!TIP] # 处替换为 tgz 包的路径 + + + +#### **npm** + +```bash +npm install react-native-easy-grid --save +``` + +#### **yarn** + +```bash +yarn add react-native-easy-grid +``` + + + +#### **导入组件** + +```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) + + + + +## 约束与限制 + + +## API + +> [!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