未验证 提交 fa8ec848 编写于 作者: O openharmony_ci 提交者: Gitee

!7280 update docs

Merge pull request !7280 from 田雨/OpenHarmony-3.1-Release
...@@ -162,7 +162,7 @@ back(options?: RouterOptions ): void ...@@ -162,7 +162,7 @@ back(options?: RouterOptions ): void
// 通过back,返回到detail页面 // 通过back,返回到detail页面
export default { export default {
backToDetail() { backToDetail() {
router.back({uri:'pages/detail/detail'}); router.back({url:'pages/detail/detail'});
} }
} }
``` ```
...@@ -334,7 +334,7 @@ getParams(): Object ...@@ -334,7 +334,7 @@ getParams(): Object
// 在detail页面中 // 在detail页面中
export default { export default {
onInit() { onInit() {
console.info('showData1:' + router.getParams().data1); console.info('showData1:' + router.getParams()[data1]);
} }
} }
``` ```
......
...@@ -215,8 +215,8 @@ struct ImageExample2 { ...@@ -215,8 +215,8 @@ struct ImageExample2 {
@Entry @Entry
@Component @Component
struct ImageExample3 { struct ImageExample3 {
@State width: number = 0 @State widthValue: number = 0
@State height: number = 0 @State heightValue: number = 0
private on: Resource = $r('app.media.wifi_on') private on: Resource = $r('app.media.wifi_on')
private off: Resource = $r('app.media.wifi_off') private off: Resource = $r('app.media.wifi_off')
private on2off: Resource = $r('app.media.wifi_on2off') private on2off: Resource = $r('app.media.wifi_on2off')
...@@ -236,13 +236,13 @@ struct ImageExample3 { ...@@ -236,13 +236,13 @@ struct ImageExample3 {
.objectFit(ImageFit.Cover) .objectFit(ImageFit.Cover)
.height(180).width(180) .height(180).width(180)
.onComplete((msg: { width: number,height: number }) => { .onComplete((msg: { width: number,height: number }) => {
this.width = msg.width this.widthValue = msg.width
this.height = msg.height this.heightValue = msg.height
}) })
.onError(() => { .onError(() => {
console.log('load image fail') console.log('load image fail')
}) })
.overlay('\nwidth: ' + String(this.width) + ' height: ' + String(this.height), { .overlay('\nwidth: ' + String(this.widthValue) + ' height: ' + String(this.heightValue), {
align: Alignment.Bottom, align: Alignment.Bottom,
offset: { x: 0, y: 20 } offset: { x: 0, y: 20 }
}) })
......
...@@ -14,27 +14,27 @@ ...@@ -14,27 +14,27 @@
PinchGesture(options?: { fingers?: number, distance?: number }) PinchGesture(options?: { fingers?: number, distance?: number })
- 参数 - 参数
| 参数名称 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名称 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| fingers | number | 否 | 2 | 触发捏合的最少手指数, 最小为2指,最大为5指。 | | fingers | number | 否 | 2 | 触发捏合的最少手指数, 最小为2指,最大为5指。 |
| distance | number | 否 | 3.0 | 最小识别距离,单位为vp。 | | distance | number | 否 | 3.0 | 最小识别距离,单位为vp。 |
## 事件 ## 事件
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onActionStart((event?: GestureEvent) => void) | Pinch手势识别成功回调。 | | onActionStart((event?: GestureEvent) => void) | Pinch手势识别成功回调。 |
| onActionUpdate((event?: GestureEvent) => void) | Pinch手势移动过程中回调。 | | onActionUpdate((event?: GestureEvent) => void) | Pinch手势移动过程中回调。 |
| onActionEnd((event?: GestureEvent) => void) | Pinch手势识别成功,手指抬起后触发回调。 | | onActionEnd((event?: GestureEvent) => void) | Pinch手势识别成功,手指抬起后触发回调。 |
| onActionCancel(event: () => void) | Pinch手势识别成功,接收到触摸取消事件触发回调。 | | onActionCancel(event: () => void) | Pinch手势识别成功,接收到触摸取消事件触发回调。 |
- GestureEvent对象中与Pinch手势相关的属性 - GestureEvent对象中与Pinch手势相关的属性
| 属性名称 | 属性类型 | 描述 | | 属性名称 | 属性类型 | 描述 |
| -------- | -------- | -------- | | -------- | -------- | -------- |
| scale | number | 缩放比例,用于PinchGesture手势触发场景。 | | scale | number | 缩放比例,用于PinchGesture手势触发场景。 |
| pinchCenterX | number | 捏合手势中心点X轴坐标,单位为px。 | | pinchCenterX | number | 捏合手势中心点X轴坐标,单位为px。 |
| pinchCenterY | number | 捏合手势中心点Y轴坐标,单位为px。 | | pinchCenterY | number | 捏合手势中心点Y轴坐标,单位为px。 |
## 示例 ## 示例
...@@ -43,21 +43,21 @@ PinchGesture(options?: { fingers?: number, distance?: number }) ...@@ -43,21 +43,21 @@ PinchGesture(options?: { fingers?: number, distance?: number })
@Entry @Entry
@Component @Component
struct PinchGestureExample { struct PinchGestureExample {
@State scale: number = 1 @State scaleValue: number = 1
build() { build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Text('PinchGesture scale:' + this.scale) Text('PinchGesture scale:' + this.scale)
} }
.height(100).width(200).padding(20).border({ width: 1 }).margin(80) .height(100).width(200).padding(20).border({ width: 1 }).margin(80)
.scale({ x: this.scale, y: this.scale, z: this.scale }) .scale({ x: this.scaleValue, y: this.scaleValue, z: this.scaleValue })
.gesture( .gesture(
PinchGesture() PinchGesture()
.onActionStart((event: GestureEvent) => { .onActionStart((event: GestureEvent) => {
console.info('Pinch start') console.info('Pinch start')
}) })
.onActionUpdate((event: GestureEvent) => { .onActionUpdate((event: GestureEvent) => {
this.scale = event.scale this.scaleValue = event.scale
}) })
.onActionEnd(() => { .onActionEnd(() => {
console.info('Pinch end') console.info('Pinch end')
......
...@@ -43,7 +43,7 @@ Flex(options?: { direction?: FlexDirection, wrap?: FlexWrap, justifyContent?: F ...@@ -43,7 +43,7 @@ Flex(options?: { direction?: FlexDirection, wrap?: FlexWrap, justifyContent?: F
- FlexWrap枚举说明 - FlexWrap枚举说明
| 名称 | 描述 | | 名称 | 描述 |
| -------- | -------- | | -------- | -------- |
| NoWrap | Flex容器的元素单行/列布局,子项允许超出容器。 | | NoWrap | Flex容器的元素单行/列布局,子项允许超出容器。 |
| Wrap | Flex容器的元素多行/列排布,子项允许超出容器。 | | Wrap | Flex容器的元素多行/列排布,子项允许超出容器。 |
| WrapReverse | Flex容器的元素反向多行/列排布,子项允许超出容器。 | | WrapReverse | Flex容器的元素反向多行/列排布,子项允许超出容器。 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册