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

!20180 标题调整+低错修改

Merge pull request !20180 from LiAn/master
......@@ -169,7 +169,7 @@ struct FancyUse {
Text(`${this.label}`)
.fancyText(200, Color.Pink)
Text(`${this.label}`)
.fancyText(200, Color.Orange)
.fancyText(300, Color.Orange)
}.margin('20%')
}
}
......
......@@ -32,7 +32,7 @@
- [栅格设置](ts-universal-attributes-grid.md)
- [颜色渐变](ts-universal-attributes-gradient-color.md)
- [Popup控制](ts-universal-attributes-popup.md)
- [Menu控制](ts-universal-attributes-menu.md)
- [菜单控制](ts-universal-attributes-menu.md)
- [焦点控制](ts-universal-attributes-focus.md)
- [悬浮态效果](ts-universal-attributes-hover-effect.md)
- [组件标识](ts-universal-attributes-component-id.md)
......@@ -47,8 +47,8 @@
- [全屏模态转场](ts-universal-attributes-modal-transition.md)
- [半模态转场](ts-universal-attributes-sheet-transition.md)
- [隐私遮罩](ts-universal-attributes-obscured.md)
- [文本通用属性](ts-universal-attributes-text-style.md)
- [安全控件通用属性](ts-universal-attributes-securitycomponent.md)
- [文本通用](ts-universal-attributes-text-style.md)
- [安全控件通用](ts-universal-attributes-securitycomponent.md)
- 手势处理
- [绑定手势方法](ts-gesture-settings.md)
- 基础手势
......
......@@ -39,7 +39,7 @@ Navigation组件一般作为Page页面的根容器,通过属性设置来展示
| toolBar | [object](#object类型说明)&nbsp;\|&nbsp;[CustomBuilder](ts-types.md#custombuilder8)<sup>8+</sup> | 设置工具栏内容。不设置时不显示工具栏。<br/>items:&nbsp;工具栏所有项。<br/>**说明:** <br/>items均分底部工具栏,在每个均分内容区布局文本和图标,文本超长时,逐级缩小,缩小之后换行,最后...截断。 |
| hideToolBar | boolean | 隐藏工具栏。<br/>默认值:false<br/>true:&nbsp;隐藏工具栏。<br/>false:&nbsp;显示工具栏。 |
| hideTitleBar | boolean | 隐藏标题栏。<br/>默认值:false<br/>true:&nbsp;隐藏标题栏。<br/>false:&nbsp;显示标题栏。 |
| hideBackButton | boolean | 隐藏返回键。<br/>默认值:false<br/>true:&nbsp;隐藏返回键。<br/>false:&nbsp;显示返回键。 <br>不支持隐藏NavDestination组件标题栏中的返回图标。<br/>**说明:** <br/>返回键仅针对titleMode为NavigationTitleMode.Mini时才生效。 |
| hideBackButton | boolean | 隐藏返回键。<br/>默认值:false<br/>true:&nbsp;隐藏返回键。<br/>false:&nbsp;显示返回键。 <br>不支持隐藏NavDestination组件标题栏中的返回图标。<br/>**说明:** <br/>返回键仅针对titleMode为NavigationTitleMode.Mini时才生效。 |
| navBarWidth<sup>9+</sup> | [Length](ts-types.md#length) | 导航栏宽度。<br/>默认值:200<br/>单位:vp<br/>**说明:** <br/>仅在Navigation组件分栏时生效。 |
| navBarPosition<sup>9+</sup> | [NavBarPosition](#navbarposition枚举说明) | 导航栏位置。<br/>默认值:NavBarPosition.Start<br/>**说明:** <br/>仅在Navigation组件分栏时生效。 |
| mode<sup>9+</sup> | [NavigationMode](#navigationmode枚举说明) | 导航栏的显示模式。<br/>默认值:NavigationMode.Auto<br/>自适应:基于组件宽度自适应单栏和双栏。 |
......
# Menu控制
# 菜单控制
为组件绑定弹出式菜单,弹出式菜单以垂直列表形式显示菜单项,可通过长按、点击或鼠标右键触发。
......@@ -12,37 +12,37 @@
## 属性
| 名称 | 参数类型 | 描述 |
| ---------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| 名称 | 参数类型 | 描述 |
| ---------------------------- | ---------------------------------------- | ---------------------------------------- |
| bindMenu | content: Array<[MenuItem](#menuitem)&gt;&nbsp;\|&nbsp;[CustomBuilder](ts-types.md#custombuilder8),<br>options: [MenuOptions](#menuoptions10) | 给组件绑定菜单,点击后弹出菜单。弹出菜单项支持图标+文本排列和自定义两种功能。<br/>content: 必填,配置菜单项图标和文本的数组,或者自定义组件。<br/>options: 非必填,配置弹出菜单的参数。 |
| bindContextMenu<sup>8+</sup> | content:&nbsp;[CustomBuilder](ts-types.md#custombuilder8),<br>responseType:&nbsp;[ResponseType](ts-appendix-enums.md#responsetype8)<br>options: [ContextMenuOptions](#contextmenuoptions10) | 给组件绑定菜单,触发方式为长按或者右键点击,弹出菜单项需要自定义。<br/>responseType: 必填。菜单弹出条件,长按或者右键点击。<br/>options: 非必填,配置弹出菜单的参数。 |
## MenuItem
| 名称 | 类型 | 必填 | 描述 |
| ------------------ | -------------------------------------- | ---- | ---------------------- |
| value | string | 是 | 菜单项文本。 |
| icon<sup>10+</sup> | [ResourceStr](ts-types.md#resourcestr) | 否 | 菜单项图标。 |
| action | ()&nbsp;=&gt;&nbsp;void | 是 | 点击菜单项的事件回调。 |
| 名称 | 类型 | 必填 | 描述 |
| ------------------ | -------------------------------------- | ---- | ----------- |
| value | string | 是 | 菜单项文本。 |
| icon<sup>10+</sup> | [ResourceStr](ts-types.md#resourcestr) | 否 | 菜单项图标。 |
| action | ()&nbsp;=&gt;&nbsp;void | 是 | 点击菜单项的事件回调。 |
## MenuOptions<sup>10+</sup>
| 名称 | 类型 | 必填 | 描述 |
| ------ | -------------------------------- | ---- | ------------------------------------------------------ |
| title | string | 否 | 菜单标题。 |
| offset | [Position](ts-types.md#position8) | 否 | 菜单弹出位置的偏移量,不会导致菜单显示超出屏幕范围。 |
| placement | [Placement](ts-appendix-enums.md#placement8) | 否 | 菜单组件优先显示的位置,当前位置显示不下时,会自动调整位置。<br/>**说明:**<br />placement值设置为undefined、null或没有设置此选项时,按默认值[BottomLeft](ts-appendix-enums.md#placement8)处理,相对父组件区域弹出。 |
| onAppear | ()&nbsp;=&gt;&nbsp;void | 否 | 菜单弹出时的事件回调。 |
| onDisappear | ()&nbsp;=&gt;&nbsp;void | 否 | 菜单消失时的事件回调。 |
| 名称 | 类型 | 必填 | 描述 |
| ----------- | ---------------------------------------- | ---- | ---------------------------------------- |
| title | string | 否 | 菜单标题。 |
| offset | [Position](ts-types.md#position8) | 否 | 菜单弹出位置的偏移量,不会导致菜单显示超出屏幕范围。 |
| placement | [Placement](ts-appendix-enums.md#placement8) | 否 | 菜单组件优先显示的位置,当前位置显示不下时,会自动调整位置。<br/>**说明:**<br />placement值设置为undefined、null或没有设置此选项时,按默认值[BottomLeft](ts-appendix-enums.md#placement8)处理,相对父组件区域弹出。 |
| onAppear | ()&nbsp;=&gt;&nbsp;void | 否 | 菜单弹出时的事件回调。 |
| onDisappear | ()&nbsp;=&gt;&nbsp;void | 否 | 菜单消失时的事件回调。 |
## ContextMenuOptions<sup>10+</sup>
| 名称 | 类型 | 必填 | 描述 |
| ----------- | -------------------------------------------- | ---- | ------------------------------------------------------------ |
| offset | [Position](ts-types.md#position8) | 否 | 菜单弹出位置的偏移量,不会导致菜单显示超出屏幕范围。 |
| placement | [Placement](ts-appendix-enums.md#placement8) | 否 | 菜单组件优先显示的位置,当前位置显示不下时,会自动调整位置。<br/>**说明:**<br />placement值设置为undefined、null或没有设置此选项时,按未设置placement处理,菜单跟随点击位置弹出。 |
| onAppear | ()&nbsp;=&gt;&nbsp;void | 否 | 菜单弹出时的事件回调。 |
| onDisappear | ()&nbsp;=&gt;&nbsp;void | 否 | 菜单消失时的事件回调。 |
| 名称 | 类型 | 必填 | 描述 |
| ----------- | ---------------------------------------- | ---- | ---------------------------------------- |
| offset | [Position](ts-types.md#position8) | 否 | 菜单弹出位置的偏移量,不会导致菜单显示超出屏幕范围。 |
| placement | [Placement](ts-appendix-enums.md#placement8) | 否 | 菜单组件优先显示的位置,当前位置显示不下时,会自动调整位置。<br/>**说明:**<br />placement值设置为undefined、null或没有设置此选项时,按未设置placement处理,菜单跟随点击位置弹出。 |
| onAppear | ()&nbsp;=&gt;&nbsp;void | 否 | 菜单弹出时的事件回调。 |
| onDisappear | ()&nbsp;=&gt;&nbsp;void | 否 | 菜单消失时的事件回调。 |
## 示例
......
# 安全组件通用属性
# 安全组件通用
安全组件的基础属性,用于设置安全组件通用的属性。
......@@ -8,40 +8,40 @@
## 属性
| 名称 | 参数类型 | 必填 | 描述 |
| ----------- | ------ | ---- | ---------------------------------------- |
| iconSize | [Length](ts-types.md#length) | 否 | 设置安全组件上图标的尺寸。<br/> 默认值:16vp |
| layoutDirection | [SecurityComponentLayoutDirection](#securitycomponentlayoutdirection枚举说明) | 否 | 设置安全组件上图标和文字分布的方向。 <br/> 默认值:SecurityComponentLayoutDirection.HORIZONTAL|
| layoutOrder | [SecurityComponentLayoutOrder](#securitycomponentlayoutorder枚举说明) | 否 | 设置安全组件上图标和文字分布的顺序。 <br/> 默认值:SecurityComponentLayoutOrder.ICON_FIRST|
| position | [Position](ts-types.md#position8) | 否 | 设置绝对定位,设置安全组件的左上角相对于父容器左上角的偏移位置。<br/> 默认值:<br/>{ <br/>x: 0,<br/>y: 0<br/>} |
| markAnchor | [Position](ts-types.md#position8) | 否 | 设置绝对定位的锚点,以安全组件的左上角作为基准点进行偏移。<br/> 默认值:<br/>{ <br/>x: 0,<br/>y: 0<br/>} |
| offset | [Position](ts-types.md#position8) | 否 | 设置相对定位,安全组件相对于自身的偏移量。<br/> 默认值:<br/>{ <br/>x: 0,<br/>y: 0<br/>} |
| fontSize | [Length](ts-types.md#length) | 否 | 设置安全组件上文字的尺寸。<br/> 默认值:16fp |
| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | 否 | 设置安全组件上文字的样式。<br/> 默认值:FontStyle.Normal |
| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | 否 | 设置安全组件上文字粗细。 <br/> 默认值:FontWeight.Medium |
| fontFamily | string \| [Resource](ts-types.md#resource类型) | 否 | 设置安全组件上文字的字体。 <br/>默认字体:'HarmonyOS Sans' |
| fontColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上文字的颜色。<br/> 默认值:#ffffffff |
| iconColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上图标的颜色。<br/> 默认值:#ffffffff |
| backgroundColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的背景颜色。 <br/> 默认值:#007dff |
| borderStyle | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | 设置安全组件的边框的样式。 <br/> 默认不设置边框样式 |
| borderWidth | [Length](ts-types.md#length) | 否 | 设置安全组件的边框的宽度。 <br/> 默认不设置边框宽度 |
| borderColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的边框的颜色。 <br/> 默认不设置边框颜色 |
| borderRadius | [Length](ts-types.md#length) | 否 | 设置安全组件的边框圆角半径。<br/> 默认值:1/2 按钮整高 |
| padding | [Padding](ts-types.md#padding) \| [Length](ts-types.md#length) | 否 | 设置安全组件的内边距。 <br/> 默认值:上下8vp, 左右24vp |
| textIconSpace | [Length](ts-types.md#length) | 否 | 设置安全组件中图标和文字的间距。 <br/> 默认值:4vp |
| 名称 | 参数类型 | 必填 | 描述 |
| --------------- | ---------------------------------------- | ---- | ---------------------------------------- |
| iconSize | [Length](ts-types.md#length) | 否 | 设置安全组件上图标的尺寸。<br/> 默认值:16vp |
| layoutDirection | [SecurityComponentLayoutDirection](#securitycomponentlayoutdirection枚举说明) | 否 | 设置安全组件上图标和文字分布的方向。 <br/> 默认值:SecurityComponentLayoutDirection.HORIZONTAL |
| layoutOrder | [SecurityComponentLayoutOrder](#securitycomponentlayoutorder枚举说明) | 否 | 设置安全组件上图标和文字分布的顺序。 <br/> 默认值:SecurityComponentLayoutOrder.ICON_FIRST |
| position | [Position](ts-types.md#position8) | 否 | 设置绝对定位,设置安全组件的左上角相对于父容器左上角的偏移位置。<br/> 默认值:<br/>{ <br/>x: 0,<br/>y: 0<br/>} |
| markAnchor | [Position](ts-types.md#position8) | 否 | 设置绝对定位的锚点,以安全组件的左上角作为基准点进行偏移。<br/> 默认值:<br/>{ <br/>x: 0,<br/>y: 0<br/>} |
| offset | [Position](ts-types.md#position8) | 否 | 设置相对定位,安全组件相对于自身的偏移量。<br/> 默认值:<br/>{ <br/>x: 0,<br/>y: 0<br/>} |
| fontSize | [Length](ts-types.md#length) | 否 | 设置安全组件上文字的尺寸。<br/> 默认值:16fp |
| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | 否 | 设置安全组件上文字的样式。<br/> 默认值:FontStyle.Normal |
| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | 否 | 设置安全组件上文字粗细。 <br/> 默认值:FontWeight.Medium |
| fontFamily | string \| [Resource](ts-types.md#resource类型) | 否 | 设置安全组件上文字的字体。 <br/>默认字体:'HarmonyOS Sans' |
| fontColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上文字的颜色。<br/> 默认值:#ffffffff |
| iconColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上图标的颜色。<br/> 默认值:#ffffffff |
| backgroundColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的背景颜色。 <br/> 默认值:#007dff |
| borderStyle | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | 设置安全组件的边框的样式。 <br/> 默认不设置边框样式 |
| borderWidth | [Length](ts-types.md#length) | 否 | 设置安全组件的边框的宽度。 <br/> 默认不设置边框宽度 |
| borderColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的边框的颜色。 <br/> 默认不设置边框颜色 |
| borderRadius | [Length](ts-types.md#length) | 否 | 设置安全组件的边框圆角半径。<br/> 默认值:1/2 按钮整高 |
| padding | [Padding](ts-types.md#padding) \| [Length](ts-types.md#length) | 否 | 设置安全组件的内边距。 <br/> 默认值:上下8vp, 左右24vp |
| textIconSpace | [Length](ts-types.md#length) | 否 | 设置安全组件中图标和文字的间距。 <br/> 默认值:4vp |
## SecurityComponentLayoutDirection枚举说明
| 名称 | 描述 |
| ------------------- | ------------------ |
| HORIZONTAL | 安全组件上图标和文字分布的方向为水平排列。 |
| VERTICAL | 安全组件上图标和文字分布的方向为垂直排列。 |
| 名称 | 描述 |
| ---------- | --------------------- |
| HORIZONTAL | 安全组件上图标和文字分布的方向为水平排列。 |
| VERTICAL | 安全组件上图标和文字分布的方向为垂直排列。 |
## SecurityComponentLayoutOrder枚举说明
| 名称 | 描述 |
| ------------------- | ------------------ |
| ICON_FIRST | 图标的排列顺序先于文字。 |
| 名称 | 描述 |
| ---------- | ------------ |
| ICON_FIRST | 图标的排列顺序先于文字。 |
| TEXT_FIRST | 文字的排列顺序先于图标。 |
## 示例
......
# 文本通用属性
# 文本通用
文本通用属性目前只针对包含文本元素的组件,设置文本样式。
> **说明:**
>
> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 属性
| 名称 | 参数类型 | 描述 |
| -----------| ---------------------------------------- | ------------------------------------ |
| fontColor | [ResourceColor](ts-types.md#resourcecolor) | 设置字体颜色。<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontSize | [Length](ts-types.md#length) | 设置字体大小,Length为number类型时,使用fp单位。字体默认大小16。不支持设置百分比字符串。<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | 设置字体样式。<br>默认值:FontStyle.Normal<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontWeight | number&nbsp;\|&nbsp;[FontWeight](ts-appendix-enums.md#fontweight)&nbsp;\|&nbsp;string | 设置文本的字体粗细,number类型取值[100,&nbsp;900],取值间隔为100,默认为400,取值越大,字体越粗。string类型仅支持number类型取值的字符串形式,例如"400",以及"bold"、"bolder"、"lighter"、"regular"、"medium",分别对应FontWeight中相应的枚举值。<br/>默认值:FontWeight.Normal<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontFamily | string&nbsp;\|&nbsp;[Resource](ts-types.md#resource) | 设置字体列表。默认字体'HarmonyOS Sans',且当前只支持这种字体。<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| 名称 | 参数类型 | 描述 |
| ---------- | ---------------------------------------- | ---------------------------------------- |
| fontColor | [ResourceColor](ts-types.md#resourcecolor) | 设置字体颜色。<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontSize | [Length](ts-types.md#length) | 设置字体大小,Length为number类型时,使用fp单位。字体默认大小16。不支持设置百分比字符串。<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | 设置字体样式。<br>默认值:FontStyle.Normal<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontWeight | number&nbsp;\|&nbsp;[FontWeight](ts-appendix-enums.md#fontweight)&nbsp;\|&nbsp;string | 设置文本的字体粗细,number类型取值[100,&nbsp;900],取值间隔为100,默认为400,取值越大,字体越粗。string类型仅支持number类型取值的字符串形式,例如"400",以及"bold"、"bolder"、"lighter"、"regular"、"medium",分别对应FontWeight中相应的枚举值。<br/>默认值:FontWeight.Normal<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontFamily | string&nbsp;\|&nbsp;[Resource](ts-types.md#resource) | 设置字体列表。默认字体'HarmonyOS Sans',且当前只支持这种字体。<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| lineHeight | string&nbsp;\|&nbsp;number&nbsp;\|&nbsp;[Resource](ts-types.md#resource) | 设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| decoration | {<br/>type:&nbsp;[TextDecorationType](ts-appendix-enums.md#textdecorationtype),<br/>color?:&nbsp;[ResourceColor](ts-types.md#resourcecolor)<br/>} | 设置文本装饰线样式及其颜色。<br />默认值:{<br/>type:&nbsp;TextDecorationType.None,<br/>color:Color.Black<br/>}<br/>从API version 9开始,该接口支持在ArkTS卡片中使用。 |
......
......@@ -4,7 +4,7 @@
前端页面和应用侧之间可以用[createWebMessagePorts()](../reference/apis/js-apis-webview.md#createwebmessageports)接口创建消息端口来实现两端的通信。
在下面的示例中,用侧页面中通过createWebMessagePorts方法创建消息端口,再把其中一个端口通过[postMessage()](../reference/apis/js-apis-webview.md#postmessage)接口发送到前端页面,便可以在前端页面和应用侧之间互相发送消息。
在下面的示例中,用侧页面中通过createWebMessagePorts方法创建消息端口,再把其中一个端口通过[postMessage()](../reference/apis/js-apis-webview.md#postmessage)接口发送到前端页面,便可以在前端页面和应用侧之间互相发送消息。
- 应用侧代码。
......
......@@ -1215,7 +1215,7 @@
- [栅格设置](reference/arkui-ts/ts-universal-attributes-grid.md)
- [颜色渐变](reference/arkui-ts/ts-universal-attributes-gradient-color.md)
- [Popup控制](reference/arkui-ts/ts-universal-attributes-popup.md)
- [Menu控制](reference/arkui-ts/ts-universal-attributes-menu.md)
- [菜单控制](reference/arkui-ts/ts-universal-attributes-menu.md)
- [焦点控制](reference/arkui-ts/ts-universal-attributes-focus.md)
- [悬浮态效果](reference/arkui-ts/ts-universal-attributes-hover-effect.md)
- [组件标识](reference/arkui-ts/ts-universal-attributes-component-id.md)
......@@ -1230,8 +1230,8 @@
- [全屏模态转场](reference/arkui-ts/ts-universal-attributes-modal-transition.md)
- [半模态转场](reference/arkui-ts/ts-universal-attributes-sheet-transition.md)
- [隐私遮罩](reference/arkui-ts/ts-universal-attributes-obscured.md)
- [文本通用属性](reference/arkui-ts/ts-universal-attributes-text-style.md)
- [安全控件通用属性](reference/arkui-ts/ts-universal-attributes-securitycomponent.md)
- [文本通用](reference/arkui-ts/ts-universal-attributes-text-style.md)
- [安全控件通用](reference/arkui-ts/ts-universal-attributes-securitycomponent.md)
- 手势处理
- [绑定手势方法](reference/arkui-ts/ts-gesture-settings.md)
- 基础手势
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册