From e5a6f8397c40bc8e60ae1bcd5e2ff5e568b1085c Mon Sep 17 00:00:00 2001 From: lushi1202 Date: Tue, 24 Jun 2025 20:44:12 +0800 Subject: [PATCH] fix demo code Signed-off-by: lushi1202 Change-Id: I9ad0261023d29ee40ce7a3389b5c1deb97dbfb95 --- .../apis-arkui/js-apis-arkui-UIContext.md | 207 +++++++++--------- 1 file changed, 103 insertions(+), 104 deletions(-) diff --git a/zh-cn/application-dev/reference/apis-arkui/js-apis-arkui-UIContext.md b/zh-cn/application-dev/reference/apis-arkui/js-apis-arkui-UIContext.md index 74b7f3de841..e55391e8479 100644 --- a/zh-cn/application-dev/reference/apis-arkui/js-apis-arkui-UIContext.md +++ b/zh-cn/application-dev/reference/apis-arkui/js-apis-arkui-UIContext.md @@ -34,7 +34,6 @@ import { UIContext } from '@kit.ArkUI'; @Entry @Component struct Index { - @build build() { Column() { Button("Button") @@ -43,7 +42,7 @@ struct Index { this.getUIContext() //其他运行逻辑 }) - } + } } } @@ -338,7 +337,7 @@ setOverlayManagerOptions(options: OverlayManagerOptions): boolean | ----- | ---------------------------------------- | ---- | ------------------------------------- | | options | [OverlayManagerOptions](#overlaymanageroptions15) | 是 | OverlayManager参数。| -**返回值:** +**返回值:** | 类型 | 说明 | | ------- | -------------- | @@ -837,7 +836,7 @@ showActionSheet(value: ActionSheetOptions): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | ------ | ------------------------------------------------------------ | ---- | -------------------- | @@ -895,7 +894,7 @@ showDatePickerDialog(options: DatePickerDialogOptions): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | ------- | ------------------------------------------------------------ | ---- | ------------------------------ | @@ -934,7 +933,7 @@ showTimePickerDialog(options: TimePickerDialogOptions): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | ------- | ------------------------------------------------------------ | ---- | ------------------------------ | @@ -995,7 +994,7 @@ showTextPickerDialog(options: TextPickerDialogOptions): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | ------- | ------------------------------------------------------------ | ---- | ------------------------------ | @@ -1393,7 +1392,7 @@ getFilteredInspectorTree(filters?: Array\): string | ------- | --------------- | ---- | ------------------------------------------------------------ | | filters | Array\ | 否 | 需要获取的组件属性的过滤列表。目前仅支持过滤字段:
"id":组件唯一标识。
"src":资源来源。
"content":元素、组件或对象所包含的信息或数据。
"editable":是否可编辑。
"scrollable":是否可滚动。
"selectable":是否可选择。
"focusable":是否可聚焦。
"focused":是否已聚焦。
如果在filters参数中包含以上一个或者多个字段,则未包含的字段会在组件属性查询结果中被过滤掉。如果用户未传入filters参数或者filters参数为空数组,则以上字段全部不会在组件属性查询结果中被过滤掉。
从API version 20开始,支持该过滤字段:
"isLayoutInspector":是否显示自定义组件的属性。
其余字段仅供测试场景使用。 | -**返回值:** +**返回值:** | 类型 | 说明 | | ------ | ---------------------------------- | @@ -1495,7 +1494,7 @@ getFilteredInspectorTreeById(id: string, depth: number, filters?: Array\ | 否 | 需要获取的组件属性的过滤列表。目前仅支持过滤字段:
"id":组件唯一标识。
"src":资源来源。
"content":元素、组件或对象所包含的信息或数据。
"editable":是否可编辑。
"scrollable":是否可滚动。
"selectable":是否可选择。
"focusable":是否可聚焦。
"focused":是否已聚焦。
其余字段仅供测试场景使用。 | -**返回值:** +**返回值:** | 类型 | 说明 | | ------ | -------------------------------------------- | @@ -1573,7 +1572,7 @@ getMeasureUtils(): MeasureUtils **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**返回值:** +**返回值:** | 类型 | 说明 | | ------ | -------------------------------------------- | @@ -1819,7 +1818,7 @@ getWindowName(): string | undefined **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**返回值:** +**返回值:** | 类型 | 说明 | | ------ | -------------------------------------------- | @@ -1867,7 +1866,7 @@ getWindowWidthBreakpoint(): WidthBreakpoint **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**返回值:** +**返回值:** | 类型 | 说明 | | ------ | -------------------------------------------- | @@ -1917,7 +1916,7 @@ getWindowHeightBreakpoint(): HeightBreakpoint **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**返回值:** +**返回值:** | 类型 | 说明 | | ------ | -------------------------------------------- | @@ -2070,7 +2069,7 @@ requireDynamicSyncScene(id: string): Array<DynamicSyncScene> | ------ | ------ | ---- | --------------------------------------- | | id | string | 是 | 节点对应的[组件标识](arkui-ts/ts-universal-attributes-component-id.md)。| -**返回值:** +**返回值:** | 类型 | 说明 | | ------ | -------------------------------------------- | @@ -2998,7 +2997,7 @@ font.registerFont({ ``` ### getSystemFontList -getSystemFontList(): Array\ +getSystemFontList(): Array\ 获取系统支持的字体名称列表。 @@ -3016,7 +3015,7 @@ getSystemFontList(): Array\ > > 该接口仅在2in1设备上生效。 -**示例:** +**示例:** ```ts @@ -3038,19 +3037,19 @@ getFontByName(fontName: string): font.FontInfo **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------ | ---- | ------- | | fontName | string | 是 | 系统的字体名。 | -**返回值:** +**返回值:** | 类型 | 说明 | | ----------------------------------------- | -------------- | | [font.FontInfo](js-apis-font.md#fontinfo10) | 字体的详细信息。 | -**示例:** +**示例:** ```ts @@ -3104,7 +3103,7 @@ getRectangleById(id: string): componentUtils.ComponentInfo | ------------------------------------------------------------ | ------------------------------------------------ | | [componentUtils.ComponentInfo](js-apis-arkui-componentUtils.md#componentinfo) | 组件大小、位置、平移缩放旋转及仿射矩阵属性信息。 | -**错误码:** +**错误码:** 以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)。 @@ -3144,7 +3143,7 @@ createComponentObserver(id: string): inspector.ComponentObserver | ---- | ------ | ---- | ------- | | id | string | 是 | 指定组件id,该id通过通用属性[id](./arkui-ts/ts-universal-attributes-component-id.md#id)或者[key](./arkui-ts/ts-universal-attributes-component-id.md#key12)设置。 | -**返回值:** +**返回值:** | 类型 | 说明 | | ------------------------------------------------------------ | -------------------------------------------------- | @@ -3191,7 +3190,7 @@ on(type: 'navDestinationUpdate', callback: Callback\ | 否 | 需要取消的监听回调,不传参数时,取消所有的Navigation监听回调。 | -**示例:** +**示例:** 参考[uiObserver.on('navDestinationUpdate')](#onnavdestinationupdate11)示例。 @@ -3282,7 +3281,7 @@ on(type: 'navDestinationUpdate', options: { navigationId: ResourceStr }, callbac **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -3353,7 +3352,7 @@ off(type: 'navDestinationUpdate', options: { navigationId: ResourceStr }, callba **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -3375,7 +3374,7 @@ on(type: 'navDestinationUpdateByUniqueId', navigationUniqueId: number, callback: **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------ | @@ -3457,7 +3456,7 @@ off(type: 'navDestinationUpdateByUniqueId', navigationUniqueId: number, callback **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------ | @@ -3479,7 +3478,7 @@ on(type: 'scrollEvent', callback: Callback\): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------- | ---- | ------------------------------------------------------------ | @@ -3500,7 +3499,7 @@ off(type: 'scrollEvent', callback?: Callback\): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------- | ---- | ------------------------------------------------------------ | @@ -3521,7 +3520,7 @@ on(type: 'scrollEvent', options: observer.ObserverOptions, callback: Callback\): voi **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -3654,7 +3653,7 @@ off(type: 'routerPageUpdate', callback?: Callback\): v **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -3682,7 +3681,7 @@ on(type: 'densityUpdate', callback: Callback\): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -3728,7 +3727,7 @@ off(type: 'densityUpdate', callback?: Callback\): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------------------------------------------------------- | ---- | -------------------------------------------------------------------------------------------- | @@ -3780,7 +3779,7 @@ on(type: 'willDraw', callback: Callback\): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -3817,7 +3816,7 @@ off(type: 'willDraw', callback?: Callback\): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -3860,7 +3859,7 @@ on(type: 'didLayout', callback: Callback\): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -3897,7 +3896,7 @@ off(type: 'didLayout', callback?: Callback\): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -3940,7 +3939,7 @@ on(type: 'navDestinationSwitch', callback: Callback\): voi **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -4429,7 +4428,7 @@ off(type: 'tabContentUpdate', callback?: Callback\): v **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -4450,7 +4449,7 @@ on(type: 'tabContentUpdate', options: observer.ObserverOptions, callback: Callba **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -4519,7 +4518,7 @@ off(type: 'tabContentUpdate', options: observer.ObserverOptions, callback?: Call **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | @@ -4541,7 +4540,7 @@ on(type: 'beforePanStart', callback: PanListenerCallback): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | @@ -4655,7 +4654,7 @@ off(type: 'beforePanStart', callback?: PanListenerCallback): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------------- | ---- | ---------------------------------------------------- | @@ -4684,7 +4683,7 @@ on(type: 'afterPanStart', callback: PanListenerCallback): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | @@ -4705,7 +4704,7 @@ off(type: 'afterPanStart', callback?: PanListenerCallback): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------------- | ---- | ---------------------------------------------------- | @@ -4726,7 +4725,7 @@ on(type: 'beforePanEnd', callback: PanListenerCallback): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | @@ -4747,7 +4746,7 @@ off(type: 'beforePanEnd', callback?: PanListenerCallback): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------------- | ---- | ---------------------------------------------------- | @@ -4768,7 +4767,7 @@ on(type: 'afterPanEnd', callback: PanListenerCallback): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | @@ -4789,7 +4788,7 @@ off(type: 'afterPanEnd', callback?: PanListenerCallback): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------------- | ---- | ---------------------------------------------------- | @@ -4814,7 +4813,7 @@ on(type: 'nodeRenderState', nodeIdentity: NodeIdentity, callback: NodeRenderStat **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | @@ -4951,7 +4950,7 @@ off(type: 'nodeRenderState', nodeIdentity: NodeIdentity, callback?: NodeRenderSt **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------------- | ---- | ---------------------------------------------------- | @@ -4973,13 +4972,13 @@ addGlobalGestureListener(type: GestureListenerType, option: GestureObserverConfi **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------- | ---- | ----------- | | type | [GestureListenerType](#gesturelistenertype20) | 是 |要监听的手势类型。 | | option | [GestureObserverConfigs](#gestureobserverconfigs20) | 是 | 绑定全局监听器时的配置选项。 | -| callback | [GestureListenerCallback](#gesturelistenercallback20) | 是 | 手势状态更新时的回调函数。 | +| callback | [GestureListenerCallback](#gesturelistenercallback20) | 是 | 手势状态更新时的回调函数。 | ### removeGlobalGestureListener20+ @@ -4991,12 +4990,12 @@ removeGlobalGestureListener(type: GestureListenerType, callback?: GestureListene **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**参数:** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ---------- | ---- | --------- | | type | [GestureListenerType](#gesturelistenertype20) | 是 | 要移除监听器的事件类型。 | -| callback | [GestureListenerCallback](#gesturelistenercallback20) | 否 | 待移除的回调函数(未提供时将清除该手势类型的所有回调)。 | +| callback | [GestureListenerCallback](#gesturelistenercallback20) | 否 | 待移除的回调函数(未提供时将清除该手势类型的所有回调)。 | **示例:** @@ -6576,7 +6575,7 @@ back(options?: router.RouterOptions ): void ```ts import { Router } from '@kit.ArkUI'; let router: Router = uiContext.getRouter(); -router.back({url:'pages/detail'}); +router.back({url:'pages/detail'}); ``` ### back12+ @@ -6628,7 +6627,7 @@ clear(): void import { Router } from '@kit.ArkUI'; let router: Router = uiContext.getRouter(); -router.clear(); +router.clear(); ``` ### getLength @@ -6653,8 +6652,8 @@ getLength(): string import { Router } from '@kit.ArkUI'; let router: Router = uiContext.getRouter(); -let size = router.getLength(); -console.info('pages stack size = ' + size); +let size = router.getLength(); +console.info('pages stack size = ' + size); ``` ### getState @@ -6708,7 +6707,7 @@ getStateByIndex(index: number): router.RouterState | undefined | --------------------------- | ------- | | router.[RouterState](js-apis-router.md#routerstate) \| undefined | 返回页面状态信息。索引不存在时返回undefined。 | -**示例:** +**示例:** ```ts @@ -6745,7 +6744,7 @@ getStateByUrl(url: string): Array | 页面状态信息。 | -**示例:** +**示例:** ```ts @@ -6794,8 +6793,8 @@ import { BusinessError } from '@kit.BasicServicesKit'; let router: Router = uiContext.getRouter(); try { - router.showAlertBeforeBackPage({ - message: 'Message Info' + router.showAlertBeforeBackPage({ + message: 'Message Info' }); } catch(error) { let message = (error as BusinessError).message; @@ -6821,7 +6820,7 @@ hideAlertBeforeBackPage(): void import { Router } from '@kit.ArkUI'; let router: Router = uiContext.getRouter(); -router.hideAlertBeforeBackPage(); +router.hideAlertBeforeBackPage(); ``` ### getParams @@ -6922,9 +6921,9 @@ import { BusinessError } from '@kit.BasicServicesKit'; let promptAction: PromptAction = uiContext.getPromptAction(); try { - promptAction.showToast({ + promptAction.showToast({ message: 'Message Info', - duration: 2000 + duration: 2000 }); } catch (error) { let message = (error as BusinessError).message; @@ -7947,7 +7946,7 @@ closeCustomDialog(dialogId: number): void | 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2.Incorrect parameters types; 3. Parameter verification failed. | | 100001 | Internal error. | -**示例:** +**示例:** ```ts import { PromptAction } from '@kit.ArkUI'; @@ -8679,7 +8678,7 @@ executeDrag(custom: CustomBuilder | DragItemInfo, dragInfo: dragController.DragI | dragInfo | [dragController.DragInfo](js-apis-arkui-dragController.md#draginfo) | 是 | 拖拽信息。 | | callback | [AsyncCallback](../apis-basic-services-kit/js-apis-base.md#asynccallback)<[dragController.DragEventParam](js-apis-arkui-dragController.md#drageventparam12)> | 是 | 拖拽结束返回结果的回调
- event:拖拽事件信息,仅包括拖拽结果。
- extraParams:拖拽事件额外信息。 | -**错误码:** +**错误码:** 以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)错误码。 | 错误码ID | 错误信息 | @@ -9034,7 +9033,7 @@ getDragPreview(): dragController.DragPreview **系统能力:** SystemCapability.ArkUI.ArkUI.Full -**返回值:** +**返回值:** | 类型 | 说明 | | ------------------------------------------------------------ | ------------------------------------------------------------ | @@ -9103,7 +9102,7 @@ cancelDataLoading(key: string): void | ------ | ------- | ---- | ------------------------------------------------------------ | | key | string | 是 | 拖拽数据的标识,用于区分每次拖拽。key可通过startDataLoading接口获取。 | -**错误码:** +**错误码:** 以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[拖拽事件错误码](./errorcode-drag-event.md)。 @@ -10519,7 +10518,7 @@ get(id: string, callback: AsyncCallback, options?: componentSnap 获取已加载的组件的截图,传入组件的[组件标识](arkui-ts/ts-universal-attributes-component-id.md#组件标识),找到对应组件进行截图。通过回调返回结果。 -> **说明:** +> **说明:** > > 截图会获取最近一帧的绘制内容。如果在组件触发更新的同时调用截图,更新的渲染内容不会被截取到,截图会返回上一帧的绘制内容。 @@ -10535,7 +10534,7 @@ get(id: string, callback: AsyncCallback, options?: componentSnap | callback | [AsyncCallback](../apis-basic-services-kit/js-apis-base.md#asynccallback)<image.[PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md)> | 是 | 截图返回结果的回调。 | | options12+ | [componentSnapshot.SnapshotOptions](js-apis-arkui-componentSnapshot.md#snapshotoptions12) | 否 | 截图相关的自定义参数。 | -**错误码:** +**错误码:** 以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)错误码和[截图错误码](errorcode-snapshot.md)。 @@ -10544,7 +10543,7 @@ get(id: string, callback: AsyncCallback, options?: componentSnap | 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2.Incorrect parameters types; 3. Parameter verification failed. | | 100001 | Invalid ID. | -**示例:** +**示例:** ```ts import { image } from '@kit.ImageKit'; @@ -10606,7 +10605,7 @@ get(id: string, options?: componentSnapshot.SnapshotOptions): Promise, delay?: number, checkImageStatus?: boolean, options?: componentSnapshot.SnapshotOptions): void 传入[CustomBuilder](arkui-ts/ts-types.md#custombuilder8)自定义组件,系统对其进行离屏构建后进行截图,并通过回调返回结果。 -> **说明:** +> **说明:** > > 由于需要等待组件构建、渲染成功,离屏截图的回调有500ms以内的延迟,不适宜使用在对性能敏感的场景。 > @@ -10677,7 +10676,7 @@ createFromBuilder(builder: CustomBuilder, callback: AsyncCallback12+ | boolean | 否 | 指定是否允许在截图之前,校验图片解码状态。如果为true,则会在截图之前检查所有Image组件是否已经解码完成,如果没有完成检查,则会放弃截图并返回异常。
默认值:false| | options12+ | [componentSnapshot.SnapshotOptions](js-apis-arkui-componentSnapshot.md#snapshotoptions12) | 否 | 截图相关的自定义参数。 | -**错误码:** +**错误码:** 以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)错误码和[截图错误码](errorcode-snapshot.md)。 @@ -10687,7 +10686,7 @@ createFromBuilder(builder: CustomBuilder, callback: AsyncCallback **说明:** +> **说明:** > > 由于需要等待组件构建、渲染成功,离屏截图的回调有500ms以内的延迟,不适宜使用在对性能敏感的场景。 > @@ -10773,7 +10772,7 @@ createFromBuilder(builder: CustomBuilder, delay?: number, checkImageStatus?: boo | ------------------------------------------------------------ | ---------------- | | Promise<image.[PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md)> | 截图返回的结果。 | -**错误码:** +**错误码:** 以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)错误码和[截图错误码](errorcode-snapshot.md)。 @@ -10783,7 +10782,7 @@ createFromBuilder(builder: CustomBuilder, delay?: number, checkImageStatus?: boo | 100001 | The builder is not a valid build function. | | 160001 | An image component in builder is not ready for taking a snapshot. The check for the ready state is required when the checkImageStatus option is enabled. | -**示例:** +**示例:** ```ts import { image } from '@kit.ImageKit'; @@ -10864,7 +10863,7 @@ getSync(id: string, options?: componentSnapshot.SnapshotOptions): image.PixelMap | ----------------------------- | -------- | | image.[PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md) | 截图返回的结果。 | -**错误码:** +**错误码:** 以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)错误码和[截图错误码](errorcode-snapshot.md)。 @@ -10935,7 +10934,7 @@ getWithUniqueId(uniqueId: number, options?: componentSnapshot.SnapshotOptions): | ------------------------------------------------------------ | ---------------- | | Promise<image.[PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md)> | 截图返回的结果。 | -**错误码:** +**错误码:** 以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)错误码和[截图错误码](errorcode-snapshot.md)。 @@ -11033,7 +11032,7 @@ getSyncWithUniqueId(uniqueId: number, options?: componentSnapshot.SnapshotOption | ----------------------------- | -------- | | image.[PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md) | 截图返回的结果。 | -**错误码:** +**错误码:** 以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)错误码和[截图错误码](errorcode-snapshot.md)。 @@ -11118,7 +11117,7 @@ createFromComponent\(content: ComponentContent\, delay?: nu | checkImageStatus | boolean | 否 | 指定是否允许在截图之前,校验图片解码状态。如果为true,则会在截图之前检查所有Image组件是否已经解码完成,如果没有完成检查,则会放弃截图并返回异常。
默认值:false| | options | [componentSnapshot.SnapshotOptions](js-apis-arkui-componentSnapshot.md#snapshotoptions12) | 否 | 截图相关的自定义参数。可以指定截图时图形侧绘制pixelmap的缩放比例与是否强制等待系统执行截图指令前所有绘制指令都执行完成之后再截图。 | -**错误码:** +**错误码:** 以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)错误码和[截图错误码](errorcode-snapshot.md)。 @@ -11128,7 +11127,7 @@ createFromComponent\(content: ComponentContent\, delay?: nu | 100001 | The builder is not a valid build function. | | 160001 | An image component in builder is not ready for taking a snapshot. The check for the ready state is required when the checkImageStatus option is enabled. | -**示例:** +**示例:** ```ts import { image } from '@kit.ImageKit'; @@ -11652,7 +11651,7 @@ static disableSystemServiceMenuItems(disable: boolean): void 屏蔽文本选择菜单内所有系统服务菜单项。 > **说明:** -> +> > 此接口调用后整个应用进程都会生效。 > > 此接口可在[UIAbility](../apis-ability-kit/js-apis-app-ability-uiAbility.md)使用。 @@ -11723,7 +11722,7 @@ static disableMenuItems(items: Array\): void 屏蔽文本选择菜单内指定的系统服务菜单项。 > **说明:** -> +> > 此接口调用后整个应用进程都会生效。 > > 此接口可在[UIAbility](../apis-ability-kit/js-apis-app-ability-uiAbility.md)使用。 @@ -11786,4 +11785,4 @@ struct Index { .height('100%') } } -``` \ No newline at end of file +``` -- Gitee