Skip to content

Commit 5ea1e7f

Browse files
committed
refactor(types): sync components types
1 parent 183b04c commit 5ea1e7f

File tree

135 files changed

+3382
-288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+3382
-288
lines changed

docs/apis/media/image/cropImage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ sidebar_label: cropImage
4646
| 4:3 | 宽高比为4比3 |
4747
| 4:5 | 宽高比为4比5 |
4848
| 5:4 | 宽高比为5比4 |
49-
| 6:19 | 宽高比为6比19 |
50-
| 19:6 | 宽高比为19比6 |
49+
| 9:16 | 宽高比为9比16 |
50+
| 16:9 | 宽高比为16比9 |
5151

5252
## 示例代码
5353

docs/apis/storage/getStorageInfoSync.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_label: getStorageInfoSync
55

66
Taro.getStorageInfo 的同步版本
77

8-
支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="百度小程序" src={require('@site/static/img/platform/swan.png').default} className="icon_platform" width="25px"/> <img title="支付宝小程序" src={require('@site/static/img/platform/alipay.png').default} className="icon_platform" width="25px"/> <img title="抖音小程序" src={require('@site/static/img/platform/tt.png').default} className="icon_platform" width="25px"/> <img title="QQ 小程序" src={require('@site/static/img/platform/qq.png').default} className="icon_platform" width="25px"/> <img title="京东小程序" src={require('@site/static/img/platform/jd.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>
8+
支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="百度小程序" src={require('@site/static/img/platform/swan.png').default} className="icon_platform" width="25px"/> <img title="支付宝小程序" src={require('@site/static/img/platform/alipay.png').default} className="icon_platform" width="25px"/> <img title="抖音小程序" src={require('@site/static/img/platform/tt.png').default} className="icon_platform" width="25px"/> <img title="QQ 小程序" src={require('@site/static/img/platform/qq.png').default} className="icon_platform" width="25px"/> <img title="京东小程序" src={require('@site/static/img/platform/jd.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>
99

1010
> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageInfoSync.html)
1111

docs/components/base/text.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export default {
119119
| space | `keyof TSpace` | || 显示连续空格 |
120120
| decode | `boolean` | `false` || 是否解码 |
121121
| numberOfLines | `number` | || 多行省略,值须大于等于 1,表现同 css 的 -webkit-line-clamp 属性一致。 |
122+
| overflow | `keyof Overflow` | `'visible'` || 文本溢出处理 |
122123
| maxLines | `number` | || 限制文本最大行数 |
123124

124125
### API 支持度
@@ -130,6 +131,7 @@ export default {
130131
| TextProps.space | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | |
131132
| TextProps.decode | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | (默认解码,不支持设置) | | |
132133
| TextProps.numberOfLines | | | ✔️ | | | | | | |
134+
| TextProps.overflow | | | | | | | | | |
133135
| TextProps.maxLines | ✔️ | | | | | | | | |
134136

135137
### TSpace
@@ -141,3 +143,12 @@ space 的合法值
141143
| ensp | 中文字符空格一半大小 |
142144
| emsp | 中文字符空格大小 |
143145
| nbsp | 根据字体设置的空格大小 |
146+
147+
### Overflow
148+
149+
| 参数 | 说明 |
150+
| --- | --- |
151+
| clip | 修剪文本 |
152+
| fade | 淡出 |
153+
| ellipsis | 显示省略号 |
154+
| visible | 文本不截断 |
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: DraggableSheet
3+
sidebar_label: DraggableSheet
4+
---
5+
6+
半屏可拖拽组件
7+
该组件需配合 DraggableSheetContext 接口使用。 目前仅在 Skyline 渲染引擎下支持。
8+
页面内拖拽是一种常见的交互效果,开发者可通过手势系统灵活实现。draggable-sheet 组件封装了常见的交互逻辑,实现起来更加简单。
9+
该组件需结合 scroll-view 使用。scroll-view 组件声明 associative-container 属性后,可与 draggable-sheet 关联起来。
10+
11+
支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>
12+
13+
> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/draggable-sheet.html)
14+
15+
## 类型
16+
17+
```tsx
18+
ComponentType<DraggableSheetProps>
19+
```
20+
21+
## DraggableSheetProps
22+
23+
| 参数 | 类型 | 默认值 | 必填 | 说明 |
24+
| --- | --- | :---: | :---: | --- |
25+
| initialChildSize | `number` | `0.5` || 初始时占父容器的比例 |
26+
| minChildSize | `number` | `0.25` || 最小时占父容器的比例 |
27+
| maxChildSize | `number` | `1.0` || 最大时占父容器的比例 |
28+
| snap | `boolean` | `false` || 拖拽后是否自动对齐关键点 |
29+
| snapSizes | `any[]` | `[]` || 拖拽后对齐的关键点,无需包含最小和最大值 |
30+
31+
### API 支持度
32+
33+
| API | 微信小程序 | H5 | React Native | Harmony |
34+
| :---: | :---: | :---: | :---: | :---: |
35+
| DraggableSheetProps.initialChildSize | ✔️ | | | |
36+
| DraggableSheetProps.minChildSize | ✔️ | | | |
37+
| DraggableSheetProps.maxChildSize | ✔️ | | | |
38+
| DraggableSheetProps.snap | ✔️ | | | |
39+
| DraggableSheetProps.snapSizes | ✔️ | | | |
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: GridBuilder
3+
sidebar_label: GridBuilder
4+
---
5+
6+
网格构造器,仅支持作为 <scroll-view type="custom"> 模式的直接子节点,仅 Skyline 支持。
7+
8+
支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>
9+
10+
> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/grid-builder.html)
11+
12+
## 类型
13+
14+
```tsx
15+
ComponentType<GridBuilderProps>
16+
```
17+
18+
## GridBuilderProps
19+
20+
| 参数 | 类型 | 默认值 | 必填 | 说明 |
21+
| --- | --- | :---: | :---: | --- |
22+
| type | "aligned" or "masonry" | `"aligned"<br /><br />可选值:<br />- aligned: 每行高度由同一行中最大高度子节点决定<br />- masonry: 瀑布流,根据子元素高度自动布局` || 布局方式 |
23+
| list | `any[]` | `[]` || 需要用于渲染的列表 |
24+
| childCount | `number` | || 完整列表的长度,如果不传则取 list 的长度作为其值 |
25+
| crossAxisCount | `number` | `2` || 交叉轴元素数量 |
26+
| maxCrossAxisExtent | `number` | `0` || 交叉轴元素最大范围 |
27+
| mainAxisGap | `number` | `0` || 主轴方向间隔 |
28+
| crossAxisGap | `number` | `0` || 交叉轴方向间隔 |
29+
| padding | `[number, number, number, number]` | `[0, 0, 0, 0]` || 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距 |
30+
| onItemBuild | `CommonEventFunction` | || 列表项创建时触发,event.detail = {index},index 即被创建的列表项序号 |
31+
| onItemDispose | `CommonEventFunction` | || 列表项回收时触发,event.detail = {index},index 即被回收的列表项序号 |
32+
33+
### API 支持度
34+
35+
| API | 微信小程序 | H5 | React Native | Harmony |
36+
| :---: | :---: | :---: | :---: | :---: |
37+
| GridBuilderProps.type | ✔️ | | | |
38+
| GridBuilderProps.list | ✔️ | | | |
39+
| GridBuilderProps.childCount | ✔️ | | | |
40+
| GridBuilderProps.crossAxisCount | ✔️ | | | |
41+
| GridBuilderProps.maxCrossAxisExtent | ✔️ | | | |
42+
| GridBuilderProps.mainAxisGap | ✔️ | | | |
43+
| GridBuilderProps.crossAxisGap | ✔️ | | | |
44+
| GridBuilderProps.padding | ✔️ | | | |
45+
| GridBuilderProps.onItemBuild | ✔️ | | | |
46+
| GridBuilderProps.onItemDispose | ✔️ | | | |

docs/components/skyline/grid-view.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ ComponentType<GridViewProps>
1919

2020
| 参数 | 类型 | 默认值 | 必填 | 说明 |
2121
| --- | --- | :---: | :---: | --- |
22-
| type | `string` | `"aligned"` || 布局方式。masonry - 瀑布流,根据子元素高度自动布局。 aligned - 每行高度由同一行中最大高度子节点决定。 |
22+
| type | "aligned" or "masonry" | `"aligned"<br /><br />可选值:<br />- aligned: 每行高度由同一行中最大高度子节点决定<br />- masonry: 瀑布流,根据子元素高度自动布局` || 布局方式 |
2323
| crossAxisCount | `number` | `2` || 交叉轴元素数量 |
2424
| mainAxisGap | `number` | `0` || 主轴方向间隔 |
2525
| crossAxisGap | `number` | `0` || 交叉轴方向间隔 |
2626
| maxCrossAxisExtent | `number` | `0` || 交叉轴元素最大范围 |
27+
| padding | `[number, number, number, number]` | `[0, 0, 0, 0]` || 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距 |
2728

2829
### API 支持度
2930

@@ -34,3 +35,4 @@ ComponentType<GridViewProps>
3435
| GridViewProps.mainAxisGap | ✔️ | | | |
3536
| GridViewProps.crossAxisGap | ✔️ | | | |
3637
| GridViewProps.maxCrossAxisExtent | ✔️ | | | |
38+
| GridViewProps.padding | ✔️ | | | |
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: ListBuilder
3+
sidebar_label: ListBuilder
4+
---
5+
6+
列表构造器,仅支持作为 <scroll-view type="custom"> 模式的直接子节点,仅 Skyline 支持。
7+
8+
支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>
9+
10+
> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/list-builder.html)
11+
12+
## 类型
13+
14+
```tsx
15+
ComponentType<ListBuilderProps>
16+
```
17+
18+
## ListBuilderProps
19+
20+
| 参数 | 类型 | 默认值 | 必填 | 说明 |
21+
| --- | --- | :---: | :---: | --- |
22+
| type | "static" or "dynamic" | `"aligned"<br /><br />可选值:<br />- static: 定高模式,所有列表项等高,需要传入 child-height<br />- dynamic: 不定高模式` || 布局方式 |
23+
| list | `any[]` | `[]` || 需要用于渲染的列表 |
24+
| childCount | `number` | || 完整列表的长度,如果不传则取 list 的长度作为其值 |
25+
| childHeight | `number` | || 列表项的高度,当 type 为 static 时必须传入 |
26+
| padding | `[number, number, number, number]` | `[0, 0, 0, 0]` || 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距 |
27+
| onItemBuild | `CommonEventFunction` | || 列表项创建时触发,event.detail = {index},index 即被创建的列表项序号 |
28+
| onItemDispose | `CommonEventFunction` | || 列表项回收时触发,event.detail = {index},index 即被回收的列表项序号 |
29+
30+
### API 支持度
31+
32+
| API | 微信小程序 | H5 | React Native | Harmony |
33+
| :---: | :---: | :---: | :---: | :---: |
34+
| ListBuilderProps.type | ✔️ | | | |
35+
| ListBuilderProps.list | ✔️ | | | |
36+
| ListBuilderProps.childCount | ✔️ | | | |
37+
| ListBuilderProps.childHeight | ✔️ | | | |
38+
| ListBuilderProps.padding | ✔️ | | | |
39+
| ListBuilderProps.onItemBuild | ✔️ | | | |
40+
| ListBuilderProps.onItemDispose | ✔️ | | | |

docs/components/skyline/list-view.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,13 @@ ComponentType<ListViewProps>
1616
```
1717

1818
## ListViewProps
19+
20+
| 参数 | 类型 | 默认值 | 必填 | 说明 |
21+
| --- | --- | :---: | :---: | --- |
22+
| padding | `[number, number, number, number]` | `[0, 0, 0, 0]` || 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距 |
23+
24+
### API 支持度
25+
26+
| API | 微信小程序 | H5 | React Native | Harmony |
27+
| :---: | :---: | :---: | :---: | :---: |
28+
| ListViewProps.padding | ✔️ | | | |
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: NestedScrollBody
3+
sidebar_label: NestedScrollBody
4+
---
5+
6+
嵌套 scroll-view 场景中属于里层 scroll-view 的节点,
7+
仅支持作为 <scroll-view type="nested"> 模式的直接子节点。
8+
不支持复数子节点,渲染时会取其第一个子节点来渲染。具体用法可参考 scroll-view
9+
10+
支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>
11+
12+
> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/nested-scroll-body.html)
13+
14+
## 类型
15+
16+
```tsx
17+
ComponentType<NestedScrollBodyProps>
18+
```
19+
20+
## NestedScrollBodyProps
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: NestedScrollHeader
3+
sidebar_label: NestedScrollHeader
4+
---
5+
6+
嵌套 scroll-view 场景中属于外层 scroll-view 的节点,
7+
仅支持作为 <scroll-view type="nested"> 模式的直接子节点。
8+
不支持复数子节点,渲染时会取其第一个子节点来渲染。具体用法可参考 scroll-view
9+
10+
支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>
11+
12+
> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/nested-scroll-header.html)
13+
14+
## 类型
15+
16+
```tsx
17+
ComponentType<NestedScrollHeaderProps>
18+
```
19+
20+
## NestedScrollHeaderProps

0 commit comments

Comments
 (0)