From 6ab22e054f64a274f8d831adbb736a08a749b6e0 Mon Sep 17 00:00:00 2001 From: Zheng Wu Date: Tue, 29 Aug 2023 16:47:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=87=E9=A2=98=E6=A0=8F?= =?UTF-8?q?=E5=86=85=E9=93=BE=E5=8F=8A=E7=A4=BA=E4=BE=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zheng Wu --- ...ts-composite-components-composetitlebar.md | 14 +++++------- ...s-composite-components-editabletitlebar.md | 18 +++++++-------- doc/ts-composite-components-selecttitlebar.md | 22 +++++++++---------- doc/ts-composite-components-tabtitlebar.md | 12 +++++----- 4 files changed, 32 insertions(+), 34 deletions(-) diff --git a/doc/ts-composite-components-composetitlebar.md b/doc/ts-composite-components-composetitlebar.md index fd6143f..375fd73 100644 --- a/doc/ts-composite-components-composetitlebar.md +++ b/doc/ts-composite-components-composetitlebar.md @@ -32,10 +32,10 @@ ComposeTitleBar({item?: ComposeTitleBarMenuItem, title: ResourceStr, subtitle?: | 参数名 | 参数类型 | 必选 | 参数描述 | | -------- | -------- | -------- | -------- | -| item | [ERROR:Invalid link:zh-cn_topic_0000001617072014.xml#xref1948916525328,link:zh-cn_topic_0000001609264184.xml#section478410410453](zh-cn_topic_0000001609264184.xml#section478410410453) | 否 | 用于左侧头像的单个菜单项目 | +| item | [ComposeTitleBarMenuItem](#composetitlebarmenuitem) | 否 | 用于左侧头像的单个菜单项目 | | title | [ResourceStr](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/reference/arkui-ts/ts-types.md/#resourcestr) | 是 | 标题 | | subtitle | [ResourceStr](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/reference/arkui-ts/ts-types.md/#resourcestr) | 否 | 副标题 | -| menuItems | Array<[ERROR:Invalid link:zh-cn_topic_0000001617072014.xml#xref33563123310,link:zh-cn_topic_0000001609264184.xml#section478410410453](zh-cn_topic_0000001609264184.xml#section478410410453)> | 否 | 右侧菜单项目列表 | +| menuItems | Array<[ComposeTitleBarMenuItem](#composetitlebarmenuitem)> | 否 | 右侧菜单项目列表 | ### ComposeTitleBarMenuItem @@ -98,7 +98,7 @@ struct Index { ``` import { ComposeTitleBar } from "@ohos.arkui.advanced.ComposeTitleBar" -import Prompt from '@system.prompt' +import prompt from '@system.prompt' @Entry @Component @@ -151,7 +151,7 @@ struct Index { ``` import { ComposeTitleBar } from "@ohos.arkui.advanced.ComposeTitleBar" -import Prompt from '@system.prompt' +import prompt from '@system.prompt' @Entry @Component @@ -161,13 +161,11 @@ struct Index { Column() { ComposeTitleBar({ menuItems: [ { isEnabled: true, value: $r('app.media.ic_public_save'), - action: () => Prompt.showToast({ message: "show toast index 1" }) + action: () => prompt.showToast({ message: "show toast index 1" }) } ], title: "啦啦啦啦啦啦啦啦啦啦啦啦啦啦", subtitle: "啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦", - item: { isEnabled: true, value: $r('app.media.app_icon'), - action: () => Prompt.showToast({message:"show toast index portrait"}) - } }) + item: { isEnabled: true, value: $r('app.media.app_icon') } }) }.width('100%') }.height('100%') } diff --git a/doc/ts-composite-components-editabletitlebar.md b/doc/ts-composite-components-editabletitlebar.md index f82a255..2a83216 100644 --- a/doc/ts-composite-components-editabletitlebar.md +++ b/doc/ts-composite-components-editabletitlebar.md @@ -32,9 +32,9 @@ EditableTitleBar({leftIconType: EditableLeftIconType, title: ResourceStr, menuIt | 参数名 | 参数类型 | 必选 | 参数描述 | | -------- | -------- | -------- | -------- | -| leftIconStyle | [ERROR:Invalid link:zh-cn_topic_0000001665632009.xml#xref19441410133613,link:zh-cn_topic_0000001658583341.xml#section1340683083317](zh-cn_topic_0000001658583341.xml#section1340683083317) | 是 | 左侧按钮类型 | +| leftIconStyle | [EditableLeftIconType](#editablelefticontype) | 是 | 左侧按钮类型 | | title | [ResourceStr](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/reference/arkui-ts/ts-types.md/#resourcestr) | 是 | 标题 | -| menuItems | Array<[ERROR:Invalid link:zh-cn_topic_0000001665632009.xml#xref81499144365,link:zh-cn_topic_0000001658583341.xml#section1287821819325](zh-cn_topic_0000001658583341.xml#section1287821819325)> | 否 | 右侧菜单项目列表 | +| menuItems | Array<[EditableTitleBarMenuItem](#editabletitlebarmenuitem)> | 否 | 右侧菜单项目列表 | | onSave | () => void | 否 | 保存时的动作闭包 | | onCancel | () => void | 否 | 当左侧按钮类型为 Left,触发取消时的动作闭包 | @@ -61,7 +61,7 @@ EditableTitleBar({leftIconType: EditableLeftIconType, title: ResourceStr, menuIt ``` import { EditableLeftIconType } from "@ohos.arkui.advanced.EditableTitleBar" import { EditableTitleBar } from "@ohos.arkui.advanced.EditableTitleBar" -import Prompt from '@system.prompt' +import prompt from '@system.prompt' @Entry @Component @@ -74,10 +74,10 @@ struct Index { title: "编辑页面", menuItems: [], onCancel: () => { - Prompt.showToast({ message: "on cancel" }) + prompt.showToast({ message: "on cancel" }) }, onSave: () => { - Prompt.showToast({ message: "on save" }) + prompt.showToast({ message: "on save" }) } }) }.width('100%') @@ -95,7 +95,7 @@ struct Index { ``` import { EditableLeftIconType } from "@ohos.arkui.advanced.EditableTitleBar" import { EditableTitleBar } from "@ohos.arkui.advanced.EditableTitleBar" -import Prompt from '@system.prompt' +import prompt from '@system.prompt' @Entry @Component @@ -110,15 +110,15 @@ struct Index { { value: $r('app.media.ic_public_reduce'), isEnabled: false, action: () => { - Prompt.showToast({ message: "show toast index 2" }) + prompt.showToast({ message: "show toast index 2" }) } } ], onCancel: () => { - Prompt.showToast({ message: "on cancel" }) + prompt.showToast({ message: "on cancel" }) }, onSave: () => { - Prompt.showToast({ message: "on save" }) + prompt.showToast({ message: "on save" }) } }) }.width('100%') diff --git a/doc/ts-composite-components-selecttitlebar.md b/doc/ts-composite-components-selecttitlebar.md index 84af742..c85e84d 100644 --- a/doc/ts-composite-components-selecttitlebar.md +++ b/doc/ts-composite-components-selecttitlebar.md @@ -33,8 +33,8 @@ SelectTitleBar({selected: number, options: Array<SelectOption>, menuItems? | 参数名 | 参数类型 | 必选 | 装饰器类型 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | | selected | number | 是 | \@Prop | 当前选中项目的索引 | -| options | Array<SelectOption> | 是 | - | 下拉菜单中的项目 | -| menuItems | Array Prompt.showToast({ message: 'page index ' + index }), + onSelected: (index) => prompt.showToast({ message: 'page index ' + index }), hidesBackButton: true }) }.width('100%') @@ -85,7 +85,7 @@ struct Index { ``` import { SelectTitleBar } from "@ohos.arkui.advanced.SelectTitleBar" -import Prompt from '@system.prompt' +import prompt from '@system.prompt' @Entry @Component @@ -101,7 +101,7 @@ struct Index { { value: '本地本地本地本地本地(储存卡)' } ], selected: 0, - onSelected: (index) => Prompt.showToast({ message: 'page index ' + index }), + onSelected: (index) => prompt.showToast({ message: 'page index ' + index }), hidesBackButton: false }) Divider().height(2).color(0xCCCCCC) @@ -112,7 +112,7 @@ struct Index { { value: '本地本地本地本地本地(储存卡)' } ], selected: 1, - onSelected: (index) => Prompt.showToast({ message: 'page index ' + index }), + onSelected: (index) => prompt.showToast({ message: 'page index ' + index }), subtitle: "example@openharmony.cn" }) Divider().height(2).color(0xCCCCCC) @@ -123,10 +123,10 @@ struct Index { { value: '本地本地本地本地本地(储存卡)' } ], selected: 1, - onSelected: (index) => Prompt.showToast({ message: 'page index ' + index }), + onSelected: (index) => prompt.showToast({ message: 'page index ' + index }), subtitle: "example@openharmony.cn", menuItems: [ { isEnabled: true, value: $r('app.media.ic_public_save'), - action: () => Prompt.showToast({ message: "show toast index 1" }) + action: () => prompt.showToast({ message: "show toast index 1" }) } ] }) Divider().height(2).color(0xCCCCCC) @@ -143,7 +143,7 @@ struct Index { ``` import { SelectTitleBar } from "@ohos.arkui.advanced.SelectTitleBar" -import Prompt from '@system.prompt' +import prompt from '@system.prompt' @Entry @Component @@ -171,7 +171,7 @@ struct Index { { value: '本地本地本地本地本地(储存卡)' } ], selected: 0, - onSelected: (index) => Prompt.showToast({ message: 'page index ' + index }), + onSelected: (index) => prompt.showToast({ message: 'page index ' + index }), subtitle: "example@openharmony.cn", menuItems: this.menuItems, badgeValue: 99, diff --git a/doc/ts-composite-components-tabtitlebar.md b/doc/ts-composite-components-tabtitlebar.md index e079515..5d87ce2 100644 --- a/doc/ts-composite-components-tabtitlebar.md +++ b/doc/ts-composite-components-tabtitlebar.md @@ -32,8 +32,8 @@ TabTitleBar({tabItems: Array<TabTitleBarTabItem>, menuItems?: Array<Tab | 参数名 | 参数类型 | 必选 | 装饰器类型 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | -| tabItems | Array<[TabTitleBarTabItem](https://gitee.com/openharmony-sig/arkui_advanced_ui_component/blob/master/doc/ts-composite-components-tabtitlebar.md/#tabtitlebartabitem)> | 是 | - | 左侧页签项目列表,定义标题栏左侧的页签项目。 | -| menuItems | Array<[TabTitleBarMenuItem](https://gitee.com/openharmony-sig/arkui_advanced_ui_component/blob/master/doc/ts-composite-components-tabtitlebar.md/#tabtitlebarmenuitem)> | 否 | - | 右侧菜单项目列表,定义标题栏右侧的菜单项目 | +| tabItems | Array<[TabTitleBarTabItem](#tabtitlebartabitem)> | 是 | - | 左侧页签项目列表,定义标题栏左侧的页签项目。 | +| menuItems | Array<[TabTitleBarMenuItem](#tabtitlebarmenuitem)> | 否 | - | 右侧菜单项目列表,定义标题栏右侧的菜单项目 | | swiperContent | () => void | 否 | \@BuilderParam | 页签列表关联的页面内容构造器 | @@ -58,7 +58,7 @@ TabTitleBar({tabItems: Array<TabTitleBarTabItem>, menuItems?: Array<Tab ``` import { TabTitleBar } from "@ohos.arkui.advanced.TabTitleBar" -import Prompt from '@system.prompt' +import prompt from '@system.prompt' @Entry @Component @@ -101,13 +101,13 @@ struct Index { icon: $r('app.media.emoji_happy') } ] private readonly menuItems: { value: Resource, isEnabled: boolean, action: () => void }[] = [ { isEnabled: true, value: $r('app.media.ic_public_reduce'), - action: () => Prompt.showToast({ message: "on item click! index 0" }) + action: () => prompt.showToast({ message: "on item click! index 0" }) }, { isEnabled: true, value: $r('app.media.ic_public_edit'), - action: () => Prompt.showToast({ message: "on item click! index 1" }) + action: () => prompt.showToast({ message: "on item click! index 1" }) }, { isEnabled: true, value: $r('app.media.ic_public_save'), - action: () => Prompt.showToast({ message: "on item click! index 2" }) + action: () => prompt.showToast({ message: "on item click! index 2" }) } ] build() { Row() { -- Gitee