diff --git a/zh-cn/application-dev/reference/apis/js-apis-router.md b/zh-cn/application-dev/reference/apis/js-apis-router.md index 56c5d18984b5a2682cf9d2a0ffb6a328ea4a16a3..a5b6ed0950a94b414b728557a13c70efad7963e8 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-router.md +++ b/zh-cn/application-dev/reference/apis/js-apis-router.md @@ -115,7 +115,7 @@ back(options?: RouterOptions ): void **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| options | [RouterOptions](#routeroptions) | 是 | 返回页面描述信息,其中参数url指路由跳转时会返回到指定url的界面,如果页面栈上没有url页面,则不响应该情况。如果url未设置,则返回上一页。 | +| options | [RouterOptions](#routeroptions) | 是 | 返回页面描述信息,其中参数url指路由跳转时会返回到指定url的界面,如果页面栈上没有url页面,则不响应该情况。如果url未设置,则返回上一页,页面栈里面的page不会回收,出栈后会回收。 | **示例:** ```js diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219744203.gif b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219744203.gif index 17ae76b8141d65147f9774d130711f46bf332d02..e7d48ab2c51ec839cf0339f39e9235e4132d2e53 100644 Binary files a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219744203.gif and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219744203.gif differ diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md index 68a709edb5bb657b47eef303399006f31d53f774..9f11de083b79f5efd32d63dbf939119e6994e5e2 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md @@ -17,7 +17,7 @@ import lottie from '@ohos/lottieETS' ``` > **说明:** -> 在Terminal窗口使用 `npm install @ohos/lottieETS` 命令下载Lottie。 +> 在Terminal窗口使用 `npm install @ohos/lottieETS` 命令下载Lottie,下载之前需要配置权限。 ## lottie.loadAnimation @@ -63,7 +63,7 @@ destroy(name: string): void private animatePath: string = "common/lottie/data.json" private animateItem: any = null - private onPageHide(): void { + onPageHide(): void { console.log('onPageHide') lottie.destroy() } diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md index 4608aba9dc8edc10aca85072454448606546cd61..b3f20a6fd3a058e1c7e8a6d8abc7e002cdfb37a3 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md @@ -63,17 +63,23 @@ close(): void ## 示例 ``` +// xxx.ets @CustomDialog struct CustomDialogExample { + @Link textValue: string + @Link inputValue: string controller: CustomDialogController cancel: () => void confirm: () => void build() { Column() { - Text('Software uninstall').width('70%').fontSize(20).margin({ top: 10, bottom: 10 }) - Image($r('app.media.icon')).width(80).height(80) - Text('Whether to uninstall a software?').fontSize(16).margin({ bottom: 10 }) + Text('Change text').fontSize(20).margin({ top: 10, bottom: 10 }) + TextInput({ placeholder: '', text: this.textValue }).height(60).width('90%') + .onChange((value: string) => { + this.textValue = value + }) + Text('Whether to change a text?').fontSize(16).margin({ bottom: 10 }) Flex({ justifyContent: FlexAlign.SpaceAround }) { Button('cancel') .onClick(() => { @@ -82,6 +88,7 @@ struct CustomDialogExample { }).backgroundColor(0xffffff).fontColor(Color.Black) Button('confirm') .onClick(() => { + this.inputValue = this.textValue this.controller.close() this.confirm() }).backgroundColor(0xffffff).fontColor(Color.Red) @@ -93,8 +100,10 @@ struct CustomDialogExample { @Entry @Component struct CustomDialogUser { + @State textValue: string = '' + @State inputValue: string = 'click me' dialogController: CustomDialogController = new CustomDialogController({ - builder: CustomDialogExample({ cancel: this.onCancel, confirm: this.onAccept }), + builder: CustomDialogExample({ cancel: this.onCancel, confirm: this.onAccept, textValue: $textValue, inputValue: $inputValue }), cancel: this.existApp, autoCancel: true }) @@ -111,7 +120,7 @@ struct CustomDialogUser { build() { Column() { - Button('click me') + Button(this.inputValue) .onClick(() => { this.dialogController.open() }).backgroundColor(0x317aff) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-size.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-size.md index eec98e9ba2cf6dadcdcd077c42f9b9bb5ae2e1f4..474f34717426e12263e2d5cbaeb61354744465ec 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-size.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-size.md @@ -13,15 +13,15 @@ ## 属性 -| 名称 | 参数说明 | 默认值 | 描述 | -| -------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| width | Length | - | 设置组件自身的宽度,缺省时使用元素自身内容需要的宽度。 | -| height | Length | - | 设置组件自身的高度,缺省时使用元素自身内容需要的高度。 | -| size | {
width?: Length,
height?: Length
} | - | 设置高宽尺寸。 | -| padding | {
top?: Length,
right?: Length,
bottom?: Length,
left?: Length
} \| Length | 0 | 设置内边距属性。
参数为Length类型时,四个方向内边距同时生效。 | -| margin | {
top?: Length,
right?: Length,
bottom?: Length,
left?: Length
}
\| Length | 0 | 设置外边距属性。
参数为Length类型时,四个方向外边距同时生效。 | -| constraintSize | {
minWidth?: Length,
maxWidth?: Length,
minHeight?: Length,
maxHeight?: Length
} | {
minWidth: 0,
maxWidth: Infinity,
minHeight: 0,
maxHeight: Infinity
} | 设置约束尺寸,组件布局时,进行尺寸范围限制。 | -| layoutWeight | number | 0 | 容器尺寸确定时,元素与兄弟节点主轴布局尺寸按照权重进行分配,忽略本身尺寸设置。
>  **说明:**
> 仅在Row/Column/Flex布局中生效。 | +| 名称 | 参数说明 | 默认值 | 描述 | +| -------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| width | Length | - | 设置组件自身的宽度,缺省时使用元素自身内容需要的宽度。 | +| height | Length | - | 设置组件自身的高度,缺省时使用元素自身内容需要的高度。 | +| size | {
width?: Length,
height?: Length
} | - | 设置高宽尺寸。 | +| padding | {
top?: Length,
right?: Length,
bottom?: Length,
left?: Length
} \| Length | 0 | 设置内边距属性。
参数为Length类型时,四个方向内边距同时生效。 | +| margin | {
top?: Length,
right?: Length,
bottom?: Length,
left?: Length
}
\| Length | 0 | 设置外边距属性。
参数为Length类型时,四个方向外边距同时生效。 | +| constraintSize | {
minWidth?: Length,
maxWidth?: Length,
minHeight?: Length,
maxHeight?: Length
} | {
minWidth: 0,
maxWidth: Infinity,
minHeight: 0,
maxHeight: Infinity
} | 设置约束尺寸,组件布局时,进行尺寸范围限制。 | +| layoutWeight | number | 0 | 容器尺寸确定时,元素与兄弟节点主轴布局尺寸按照权重进行分配,忽略本身尺寸设置,表示自适应占满剩余空间。
>  **说明:**
> 仅在Row/Column/Flex布局中生效。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md index 8de6233baf2968474c35b745a46e6a56ddd62238..50001dd6a221100e522df08b40cd5c98aee5f580 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md @@ -21,13 +21,13 @@ ### 属性 -| 属性名称 | 类型 | 描述 | -| ------------------- | ---------------------------------------- | ------------ | -| type | TouchType | 触摸事件的类型。 | -| touches | Array<[TouchObject](#touchobject对象说明)> | 全部手指信息。 | -| changedTouches | Array<[TouchObject](#touchobject对象说明)> | 当前发生变化的手指信息。 | -| timestamp | number | 事件时间戳。 | -| target8+ | [EventTarget](ts-universal-events-click.md#eventtarget8对象说明) | 被触摸元素对象。 | +| 属性名称 | 类型 | 描述 | +| ------------------- | ------------------------------------------------------------ | ---------------------------------- | +| type | TouchType | 触摸事件的类型。 | +| touches | Array<[TouchObject](#touchobject对象说明)> | 全部手指信息。 | +| changedTouches | Array<[TouchObject](#touchobject对象说明)> | 当前发生变化的手指信息。 | +| timestamp | number | 距离开机时间的时间戳,单位为毫秒。 | +| target8+ | [EventTarget](ts-universal-events-click.md#eventtarget8对象说明) | 被触摸元素对象。 | ### 接口 @@ -47,12 +47,12 @@ ## TouchType枚举说明 -| 名称 | 描述 | -| ------ | --------------- | -| Down | 手指按下时触发。 | -| Up | 手指抬起时触发。 | -| Move | 手指按压态在屏幕上移动时触发。 | -| Cancel | 触摸事件取消时触发。 | +| 名称 | 描述 | +| ------ | ---------------------------------- | +| Down | 手指按下时触发。 | +| Up | 手指抬起时触发。 | +| Move | 手指按压态在屏幕上移动时触发。 | +| Cancel | 触摸交互过程中应用退到后台时触发。 | ## 示例 diff --git a/zh-cn/application-dev/ui/ts-component-states-state.md b/zh-cn/application-dev/ui/ts-component-states-state.md index 6db720203f0641239c0c4084deca000201db9893..866d6ed814d570a59eedade027b982841d47669e 100644 --- a/zh-cn/application-dev/ui/ts-component-states-state.md +++ b/zh-cn/application-dev/ui/ts-component-states-state.md @@ -1,6 +1,6 @@ # @State -@State装饰的变量是组件内部的状态数据,当这些状态数据被修改时,将会调用所在组件的build方法进行UI刷新。 +@State装饰的变量是组件内部的状态数据,当这些状态数据被修改时,将会调用所在组件的build方法进行UI刷新,只能监听第一层数据的改变,内层数据的改变@State监听不到,无法触发build生命周期。 @State状态数据具有以下特征: