Skip to content

Commit

Permalink
chore(docs): update transform docs
Browse files Browse the repository at this point in the history
  • Loading branch information
iPel committed Nov 24, 2023
1 parent 403221c commit 5d8771c
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions docs/api/style/transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ transform: [{ rotateX: '45deg' }, { rotateZ: '0.785398rad' }]

它与 CSS 的 transform 参数类似,请参考 [MDN](//developer.mozilla.org/zh-CN/docs/Web/CSS/transform) 上的详细信息。

| 类型 | 必需 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| array of object: { perspective: number }, object: { rotate: string }, object: { rotateX: string }, object: { rotateY: string }, object: { rotateZ: string }, object: { scale: number }, object: { scaleX: number }, object: { scaleY: number }, object: { translateX: number }, object: {translateY: number}, object: { skewX: string }, object: { skewY: string } ||
| 参数 | 描述 | 类型 | 支持平台 |
| ----------- | ------------------------------------------------------------ | -------- | -------------- |
| perspective | 指定观察者与 z=0 平面的距离,默认值`1280`,Android 从 `3.2.0` 版本开始支持 | `number` | `Android、iOS` |
| rotate | 旋转,角度或弧度 | `string` | `Android、iOS` |
| rotateX | X轴旋转,角度或弧度 | `string` | `Android、iOS` |
| rotateY | Y轴旋转,角度或弧度 | `string` | `Android、iOS` |
| rotateZ | Z轴旋转(同rotate) | `string` | `Android、iOS` |
| scale | 缩放 | `number` | `Android、iOS` |
| scaleX | X轴缩放 | `number` | `Android、iOS` |
| scaleY | Y轴缩放 | `number` | `Android、iOS` |
| translateX | X轴平移 | `number` | `Android、iOS` |
| translateY | Y轴平移 | `number` | `Android、iOS` |
| skewX | X轴倾斜,角度或弧度 | `string` | `iOS` |
| skewY | Y轴倾斜,角度或弧度 | `string` | `iOS` |

!> Android 不支持 `skewX``skewY`

!> Android 从 `3.2.0` 版本开始支持设置perspective,并把默认值改为和 iOS 一致。

!> Android 旧版本处理多个变形参数的顺序是反转的,从 `3.2.0` 开始改为和 iOS 一致。

0 comments on commit 5d8771c

Please sign in to comment.