diff --git a/zh-cn/application-dev/reference/apis/js-apis-logs.md b/zh-cn/application-dev/reference/apis/js-apis-logs.md index 7d674cff693aca7487a509296c378803051e5d8a..0d5d7d765d89621a34c638da9f99f277ed01d8fc 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-logs.md +++ b/zh-cn/application-dev/reference/apis/js-apis-logs.md @@ -1,5 +1,8 @@ # 日志打印 +> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> 从API Version 7 开始,该接口不再维护,推荐使用新接口['@ohos.hilog](js-apis-hilog.md)'。 + ## console.debug debug(message: string): void @@ -7,9 +10,9 @@ debug(message: string): void 打印debug级别的日志信息。 - 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | message | string | 是 | 表示要打印的文本信息。 | + | 参数名 | 类型 | 必填 | 说明 | + | ------- | ------ | ---- | ----------- | + | message | string | 是 | 表示要打印的文本信息。 | ## console.log @@ -19,9 +22,9 @@ log(message: string): void 打印debug级别的日志信息。 - 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | message | string | 是 | 表示要打印的文本信息。 | + | 参数名 | 类型 | 必填 | 说明 | + | ------- | ------ | ---- | ----------- | + | message | string | 是 | 表示要打印的文本信息。 | ## console.info @@ -31,9 +34,9 @@ info(message: string): void 打印info级别的日志信息。 - 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | message | string | 是 | 表示要打印的文本信息。 | + | 参数名 | 类型 | 必填 | 说明 | + | ------- | ------ | ---- | ----------- | + | message | string | 是 | 表示要打印的文本信息。 | ## console.warn @@ -43,9 +46,9 @@ warn(message: string): void 打印warn级别的日志信息。 - 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | message | string | 是 | 表示要打印的文本信息。 | + | 参数名 | 类型 | 必填 | 说明 | + | ------- | ------ | ---- | ----------- | + | message | string | 是 | 表示要打印的文本信息。 | ## console.error @@ -55,9 +58,9 @@ error(message: string): void 打印error级别的日志信息。 - 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | message | string | 是 | 表示要打印的文本信息。 | + | 参数名 | 类型 | 必填 | 说明 | + | ------- | ------ | ---- | ----------- | + | message | string | 是 | 表示要打印的文本信息。 | ## 示例 diff --git a/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md b/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md index cf3ab73eaede52789829d052bfe2700b75aed253..dc79f5a2c50fa91e57e256c2b247b40de14358ef 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md @@ -1,4 +1,4 @@ -资源管理 +#资源管理 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -671,10 +671,10 @@ getRawFileDescriptor(path: string, callback: AsyncCallback<RawFileDescriptor& **系统能力**:SystemCapability.Global.ResourceManager **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------- | -| path | string | 是 | rawfile文件路径 | -| callback | AsyncCallback<[RawFileDescriptor](#rawfiledescriptor8)> | 是 | 异步回调,用于返回获取的rawfile文件的descriptor | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | -------------------------------- | +| path | string | 是 | rawfile文件路径 | +| callback | AsyncCallback<[RawFileDescriptor](#rawfiledescriptor8)> | 是 | 异步回调,用于返回获取的rawfile文件的descriptor | **示例:** ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md b/zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md index 29a7a02c3d111dc386a769351083af1b6a9b8b50..ec7faf77673e02c19a2d68195f20303e91b29aa7 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md @@ -2,7 +2,9 @@ > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** -> 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> +> - 从API Version 7 开始,该接口不再维护,推荐使用新接口['@ohos.mediaquery](js-apis-mediaquery.md)'。 +> - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## 导入模块 @@ -23,14 +25,14 @@ matchMedia(condition: string): MediaQueryList **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| condition | string | 是 | 用于查询的条件。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | -------- | +| condition | string | 是 | 用于查询的条件。 | **返回值:** -| 参数类型 | 说明 | -| -------- | -------- | +| 参数类型 | 说明 | +| -------------- | ---------------------------------------- | | MediaQueryList | 表示创建MediaQueryList对象的属性,详情见下表 MediaQueryList说明。 | **示例:** @@ -49,9 +51,9 @@ export default { **系统能力:** SystemCapability.ArkUI.ArkUI.Full -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| matches | boolean | 是 | 匹配结果。 | +| 名称 | 参数类型 | 必填 | 说明 | +| ------- | ------- | ---- | ----- | +| matches | boolean | 是 | 匹配结果。 | ## MediaQueryList @@ -61,10 +63,10 @@ export default { **系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| media | string | 否 | 序列化媒体查询条件,该参数为只读。 | -| matches | boolean | 是 | 匹配结果。 | +| 名称 | 参数类型 | 必填 | 说明 | +| ------- | ------- | ---- | ----------------- | +| media | string | 否 | 序列化媒体查询条件,该参数为只读。 | +| matches | boolean | 是 | 匹配结果。 | ### onchange @@ -76,9 +78,9 @@ matches状态变化时的执行函数。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| matches | boolean | 是 | matches状态变化时值。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------- | ---- | -------------- | +| matches | boolean | 是 | matches状态变化时值。 | ### MediaQueryList.addListener @@ -91,9 +93,9 @@ addListener(callback: (event: MediaQueryEvent) => void): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| callback | (event: MediaQueryEvent) => void | 是 | 匹配条件发生变化的响应函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------- | ---- | -------------- | +| callback | (event: MediaQueryEvent) => void | 是 | 匹配条件发生变化的响应函数。 | **示例:** @@ -112,9 +114,9 @@ removeListener(callback: (event: MediaQueryEvent) => void): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| callback | (event: MediaQueryEvent) => void) | 是 | 匹配条件发生变化的响应函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------------- | ---- | -------------- | +| callback | (event: MediaQueryEvent) => void) | 是 | 匹配条件发生变化的响应函数。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-prompt.md b/zh-cn/application-dev/reference/apis/js-apis-system-prompt.md index 1af2112068693034bbb2bf6381f3299026b16c07..381eb32a90cc4cd3b40beea624c1241b5cc8a82f 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-prompt.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-prompt.md @@ -1,8 +1,11 @@ # 弹窗 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** -> - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> > - 从API Version 8 开始,该接口不再维护,推荐使用新接口['@ohos.prompt](js-apis-prompt.md)'。 +> +> +> - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## 导入模块 @@ -22,9 +25,9 @@ showToast(options: ShowToastOptions): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| options | [ShowToastOptions](#showtoastoptions) | 是 | 定义ShowToast的选项。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------------------------------------- | ---- | --------------- | +| options | [ShowToastOptions](#showtoastoptions) | 是 | 定义ShowToast的选项。 | **示例:** @@ -50,9 +53,9 @@ showDialog(options: ShowDialogOptions): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| options | [ShowDialogOptions](#showdialogoptions) | 是 | 定义显示对话框的选项。| +| 参数名 | 类型 | 必填 | 说明 | +| ------- | --------------------------------------- | ---- | ----------- | +| options | [ShowDialogOptions](#showdialogoptions) | 是 | 定义显示对话框的选项。 | **示例:** @@ -90,9 +93,9 @@ showActionMenu(options: ShowActionMenuOptions): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| options | [ShowActionMenuOptions](#showactionmenuoptions) | 是 | 定义ShowActionMenu的选项。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ---------------------------------------- | ---- | -------------------- | +| options | [ShowActionMenuOptions](#showactionmenuoptions) | 是 | 定义ShowActionMenu的选项。 | **示例:** @@ -128,11 +131,11 @@ export default { **系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| message | string | 是 | 显示的文本信息。 | -| duration | number | 否 | 默认值1500ms,建议区间:1500ms-10000ms。若小于1500ms则取默认值,最大取值为10000ms。 | -| bottom5+ | string\|number| 否 | 设置弹窗边框距离屏幕底部的位置,仅手机和平板设备支持。 | +| 名称 | 参数类型 | 必填 | 说明 | +| ------------------- | -------------- | ---- | ---------------------------------------- | +| message | string | 是 | 显示的文本信息。 | +| duration | number | 否 | 默认值1500ms,建议区间:1500ms-10000ms。若小于1500ms则取默认值,最大取值为10000ms。 | +| bottom5+ | string\|number | 否 | 设置弹窗边框距离屏幕底部的位置,仅手机和平板设备支持。 | ## Button @@ -140,10 +143,10 @@ export default { **系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| text | string | 是 | 定义按钮信息。 | -| color | string | 是 | 定义按钮颜色。 | +| 名称 | 参数类型 | 必填 | 说明 | +| ----- | ------ | ---- | ------- | +| text | string | 是 | 定义按钮信息。 | +| color | string | 是 | 定义按钮颜色。 | ## ShowDialogSuccessResponse @@ -151,9 +154,9 @@ export default { **系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| index | number | 是 | 定义数据的索引信息。 | +| 名称 | 参数类型 | 必填 | 说明 | +| ----- | ------ | ---- | ---------- | +| index | number | 是 | 定义数据的索引信息。 | ## ShowDialogOptions @@ -161,14 +164,14 @@ export default { **系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| title | string | 否 | 标题文本。 | -| message | string | 否 | 文本内容。 | -| buttons | [[Button](#button), [Button](#button)?, [Button](#button)?] | 否 | 对话框中按钮的数组,结构为:{text:'button', color: '\#666666'},支持1-6个按钮。大于6个按钮时弹窗不显示。 | -| success | (data: [ShowDialogSuccessResponse](#showdialogsuccessresponse)) => void | 否 | 接口调用成功的回调函数。 | -| cancel | (data: string, code: string) => void | 否 | 接口调用失败的回调函数。 | -| complete | (data: string) => void | 否 | 接口调用结束的回调函数。 | +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| title | string | 否 | 标题文本。 | +| message | string | 否 | 文本内容。 | +| buttons | [[Button](#button), [Button](#button)?, [Button](#button)?] | 否 | 对话框中按钮的数组,结构为:{text:'button', color: '\#666666'},支持1-6个按钮。大于6个按钮时弹窗不显示。 | +| success | (data: [ShowDialogSuccessResponse](#showdialogsuccessresponse)) => void | 否 | 接口调用成功的回调函数。 | +| cancel | (data: string, code: string) => void | 否 | 接口调用失败的回调函数。 | +| complete | (data: string) => void | 否 | 接口调用结束的回调函数。 | ## ShowActionMenuOptions6+ @@ -176,10 +179,10 @@ export default { **系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| title | string | 否 | 标题文本。 | -| buttons | [[Button](#button), [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?] | 是 | 对话框中按钮的数组,结构为:{text:'button', color: '\#666666'},支持1-6个按钮。| -| success | (tapIndex: number, errMsg: string) => void | 否 | 弹出对话框时调用。 | -| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数。 | -| complete | (data: string) => void | 否 | 关闭对话框时调用。 | +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| title | string | 否 | 标题文本。 | +| buttons | [[Button](#button), [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?] | 是 | 对话框中按钮的数组,结构为:{text:'button', color: '\#666666'},支持1-6个按钮。 | +| success | (tapIndex: number, errMsg: string) => void | 否 | 弹出对话框时调用。 | +| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数。 | +| complete | (data: string) => void | 否 | 关闭对话框时调用。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-router.md b/zh-cn/application-dev/reference/apis/js-apis-system-router.md index 00aad57b6366c6692b361ef20f11850be8519748..d59e9f76ebeffd4b5c1a54004130d92e3935897b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-router.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-router.md @@ -1,8 +1,11 @@ # 页面路由 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** -> - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> > - 从API Version 8 开始,该接口不再维护,推荐使用新接口['@ohos.router'](js-apis-router.md)。 +> +> +> - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## 导入模块 @@ -22,9 +25,9 @@ push(options: RouterOptions): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| options | [RouterOptions](#routeroptions) | 是 | 页面路由参数,详细请参考RouterOptions。| +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------------------------------- | ---- | -------------------------- | +| options | [RouterOptions](#routeroptions) | 是 | 页面路由参数,详细请参考RouterOptions。 | **示例:** @@ -76,9 +79,9 @@ replace(options: RouterOptions): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| options | [RouterOptions](#routeroptions) | 是 | 页面路由参数,详细请参考RouterOptions。| +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------------------------------- | ---- | -------------------------- | +| options | [RouterOptions](#routeroptions) | 是 | 页面路由参数,详细请参考RouterOptions。 | **示例:** @@ -119,9 +122,9 @@ back(options?: BackRouterOptions): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| options | [BackRouterOptions](#backrouteroptions) | 是 | 详细请参考BackRouterOptions。| +| 参数名 | 类型 | 必填 | 说明 | +| ------- | --------------------------------------- | ---- | ----------------------- | +| options | [BackRouterOptions](#backrouteroptions) | 是 | 详细请参考BackRouterOptions。 | **示例:** @@ -191,9 +194,9 @@ getParams(): ParamsInterface **返回值:** -| 类型 | 说明 | -| -------- | -------- | -| [ParamsInterface](#paramsinterface) | 详细请参见ParamsInterface。| +| 类型 | 说明 | +| ----------------------------------- | --------------------- | +| [ParamsInterface](#paramsinterface) | 详细请参见ParamsInterface。 | ## router.clear @@ -223,8 +226,8 @@ getLength(): string **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------ | ------------------ | | string | 页面数量,页面栈支持最大数值是32。 | **示例:** @@ -248,9 +251,9 @@ getState(): RouterState **返回值:** -| 参数类型 | 说明 | -| -------- | -------- | -| [RouterState](#routerstate) | 详细请参见RouterState。| +| 参数类型 | 说明 | +| --------------------------- | ----------------- | +| [RouterState](#routerstate) | 详细请参见RouterState。 | **示例:** @@ -275,9 +278,9 @@ enableAlertBeforeBackPage(options: EnableAlertBeforeBackPageOptions): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| options | [EnableAlertBeforeBackPageOptions](#enableAlertbeforebackpageoptions6) | 是 | 详细请参见EnableAlertBeforeBackPageOptions。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ---------------------------------------- | ---- | -------------------------------------- | +| options | [EnableAlertBeforeBackPageOptions](#enableAlertbeforebackpageoptions6) | 是 | 详细请参见EnableAlertBeforeBackPageOptions。 | **示例:** @@ -307,9 +310,9 @@ disableAlertBeforeBackPage(options?: DisableAlertBeforeBackPageOptions): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| options | [DisableAlertBeforeBackPageOptions](#disablealertbeforebackpageoptions6) | 否 | 详细请参见DisableAlertBeforeBackPageOptions。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ---------------------------------------- | ---- | --------------------------------------- | +| options | [DisableAlertBeforeBackPageOptions](#disablealertbeforebackpageoptions6) | 否 | 详细请参见DisableAlertBeforeBackPageOptions。 | **示例:** @@ -334,10 +337,10 @@ export default { **系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Lite -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| uri | string | 是 | 目标页面的uri,可以是以下的两种格式:
1. 页面的绝对路径,由config.json文件中的页面列表提供。例如:
- pages/index/index
-pages/detail/detail
2. 特定路径。如果URI为斜杠(/),则显示主页。 | -| params | Object | 否 | 跳转时要同时传递到目标页面的数据,跳转到目标页面后,参数可以在页面中直接使用,如this.data1(data1为跳转时params参数中的key值)。如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 | +| 名称 | 参数类型 | 必填 | 说明 | +| ------ | ------ | ---- | ---------------------------------------- | +| uri | string | 是 | 目标页面的uri,可以是以下的两种格式:
1. 页面的绝对路径,由config.json文件中的页面列表提供。例如:
- pages/index/index
-pages/detail/detail
2. 特定路径。如果URI为斜杠(/),则显示主页。 | +| params | Object | 否 | 跳转时要同时传递到目标页面的数据,跳转到目标页面后,参数可以在页面中直接使用,如this.data1(data1为跳转时params参数中的key值)。如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 | ## BackRouterOptions @@ -346,10 +349,10 @@ export default { **系统能力:** 以下各项对应的系统能力有所不同,详见下表。 -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| uri | string | 否 | 返回到指定uri的界面,如果页面栈上没有uri页面,则不响应该情况。如果uri未设置,则返回上一页。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full| -| params | Object | 否 | 跳转时要同时传递到目标页面的数据。
**系统能力:** SystemCapability.ArkUI.ArkUI.Lite| +| 名称 | 参数类型 | 必填 | 说明 | +| ------ | ------ | ---- | ---------------------------------------- | +| uri | string | 否 | 返回到指定uri的界面,如果页面栈上没有uri页面,则不响应该情况。如果uri未设置,则返回上一页。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full | +| params | Object | 否 | 跳转时要同时传递到目标页面的数据。
**系统能力:** SystemCapability.ArkUI.ArkUI.Lite | ## RouterState @@ -357,11 +360,11 @@ export default { **系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- |-------- | -| index | number | 是 | 表示当前页面在页面栈中的索引。从栈底到栈顶,index从1开始递增。 | -| name | string | 是 | 表示当前页面的名称,即对应文件名。 | -| path | string | 是 | 表示当前页面的路径。 | +| 名称 | 参数类型 | 必填 | 说明 | +| ----- | ------ | ---- | ---------------------------------- | +| index | number | 是 | 表示当前页面在页面栈中的索引。从栈底到栈顶,index从1开始递增。 | +| name | string | 是 | 表示当前页面的名称,即对应文件名。 | +| path | string | 是 | 表示当前页面的路径。 | ## EnableAlertBeforeBackPageOptions6+ @@ -369,12 +372,12 @@ export default { **系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| message | string | 是 | 询问对话框内容。 | -| success | (errMsg: string) => void | 否 | 弹出对话框时调用,errMsg表示返回信息。 | -| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数,errMsg表示返回信息。 | -| complete | () => void | 否 | 接口调用结束的回调函数。 | +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| message | string | 是 | 询问对话框内容。 | +| success | (errMsg: string) => void | 否 | 弹出对话框时调用,errMsg表示返回信息。 | +| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数,errMsg表示返回信息。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | ## DisableAlertBeforeBackPageOptions6+ @@ -382,14 +385,14 @@ export default { **系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full -| 名称 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| success | (errMsg: string) => void | 否 | 弹出对话框时调用,errMsg表示返回信息。 | -| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数,errMsg表示返回信息。| -| complete | () => void | 否 | 接口调用结束的回调函数。 | +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| success | (errMsg: string) => void | 否 | 弹出对话框时调用,errMsg表示返回信息。 | +| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数,errMsg表示返回信息。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | ## ParamsInterface -| 名称 | 参数类型 | 说明 | -| -------- | -------- | -------- | -| [key: string] | Object| 路由参数列表。 | +| 名称 | 参数类型 | 说明 | +| ------------- | ------ | ------- | +| [key: string] | Object | 路由参数列表。 | diff --git a/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md b/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md index ee4985b077a850d20f5ce1cb2ef441643afb9a94..bed0ef4e7477d279f345db2a80e0bf23cf38bca2 100644 --- a/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md +++ b/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md @@ -24,7 +24,7 @@ ![zh-cn_image_0000001214128687](figures/zh-cn_image_0000001214128687.png) 2. 食物图片展示。 - 创建Image组件,指定Image组件的url,Image组件和Text组件都是必选构造参数组件。为了让Text组件在Image组件上方显示,所以要先声明Image组件。图片资源放在resources下的rawfile文件夹内,引用rawfile下资源时使用“$rawfile('filename')”的形式,filename为rawfile目录下的文件相对路径。当前$rawfile仅支持Image控件引用图片资源。 + 创建Image组件,指定Image组件的url,Image组件和Text组件都是必选构造参数组件。为了让Text组件在Image组件上方显示,所以要先声明Image组件。图片资源放在resources下的rawfile文件夹内,引用rawfile下资源时使用```“$rawfile('filename')”```的形式,filename为rawfile目录下的文件相对路径。当前$rawfile仅支持Image控件引用图片资源。 ``` @Entry @Component @@ -51,7 +51,7 @@ ![zh-cn_image_0000001214330169](figures/zh-cn_image_0000001214330169.png) - 就可以通过“$r('app.type.name')”的形式引用应用资源,即$r('app.media.Tomato')。 + 就可以通过```“$r('app.type.name')”```的形式引用应用资源,即$r('app.media.Tomato')。 ``` @Entry @@ -73,7 +73,7 @@ 4. 设置Image宽高,并且将image的objectFit属性设置为ImageFit.Contain,即保持图片长宽比的情况下,使得图片完整地显示在边界内。 如果Image填满了整个屏幕,原因如下: 1. Image没有设置宽高。 - + 2. Image的objectFit默认属性是ImageFit.Cover,即在保持长宽比的情况下放大或缩小,使其填满整个显示边界。 ``` @@ -183,7 +183,7 @@ .backgroundColor('#FFedf2f5') } } - + @Entry @Component struct FoodDetail { @@ -218,12 +218,12 @@ .backgroundColor('#FFedf2f5') } } - + @Component struct ContentTable { build() {} } - + @Entry @Component struct FoodDetail { @@ -261,7 +261,7 @@ .padding({ top: 30, right: 30, left: 30 }) } } - + @Entry @Component struct FoodDetail { @@ -294,7 +294,7 @@ .backgroundColor('#FFedf2f5') } } - + @Component struct ContentTable { build() { @@ -316,7 +316,7 @@ .padding({ top: 30, right: 30, left: 30 }) } } - + @Entry @Component struct FoodDetail { @@ -415,7 +415,7 @@ .padding({ top: 30, right: 30, left: 30 }) } } - + @Entry @Component struct FoodDetail { @@ -502,7 +502,7 @@ .layoutWeight(2) } } - + build() { Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Start }) { this.IngredientItem('Calories', 'Calories', '17kcal') @@ -515,7 +515,7 @@ .padding({ top: 30, right: 30, left: 30 }) } } - + @Entry @Component struct FoodDetail {