提交 d4575e0e 编写于 作者: E ester.zhou

update docs

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 0b52278e
# Panel # Panel
The **<Panel\>** component is a slidable panel that presents lightweight content with flexible sizes.
> **NOTE**<br> > **NOTE**
>
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
The **<Panel\>** component is a slidable panel that presents lightweight content with flexible sizes. It is a pop-up component.
## Required Permissions ## Required Permissions
None None
...@@ -38,6 +37,7 @@ Panel(value:{show:boolean}) ...@@ -38,6 +37,7 @@ Panel(value:{show:boolean})
| fullHeight | Length | - | Panel height in the **PanelMode.Full** mode. | | fullHeight | Length | - | Panel height in the **PanelMode.Full** mode. |
| halfHeight | Length | - | Panel height in the **PanelMode.Half** mode. The default value is half of the screen height. | | halfHeight | Length | - | Panel height in the **PanelMode.Half** mode. The default value is half of the screen height. |
| miniHeight | Length | - | Panel height in the **PanelMode.Mini** mode. | | miniHeight | Length | - | Panel height in the **PanelMode.Mini** mode. |
| backgroundMask<sup>9+</sup>|(color: ResourceColor)| - |Background mask of the panel.|
- PanelType enums - PanelType enums
| Name | Description | | Name | Description |
...@@ -58,20 +58,21 @@ Panel(value:{show:boolean}) ...@@ -58,20 +58,21 @@ Panel(value:{show:boolean})
| Name | Description | | Name | Description |
| -------- | -------- | | -------- | -------- |
| onChange(callback: (width: number, height: number, mode: PanelMode) =&gt; void) | Triggered when the panel status changes. The returned height value is the height of the content area. When the value of **dragbar** is **true**, the height of the panel is the drag bar height plus the height of the content area. | | onChange(callback: (width: number, height: number, mode: PanelMode) =&gt; void) | Triggered when the panel status changes. The returned **height** value is the height of the content area. When the value of **dragbar** is **true**, the panel height is the height of the drag bar plus the height of the content area. |
| onHeightChange(callback: (value: number) => void)<sup>9+</sup> |Triggered when the panel height changes. The returned **height** value is the height of the content area. When the value of **dragbar** is **true**, the panel height is the height of the drag bar plus the height of the content area. For user experience purposes, the panel can be slid to only this height: **fullHeight** - 8 vp. |
## Example ## Example
``` ```ts
// xxx.ets
@Entry @Entry
@Component @Component
struct PanelExample { struct PanelExample {
@State show: boolean = false @State show: boolean = false
build() { build() {
Column() { Stack() {
Text('2021-09-30 Today Calendar: 1.afternoon......Click for details') Text('2021-09-30 Today Calendar: 1.afternoon......Click for details')
.width('90%').height(50).borderRadius(10) .width('90%').height(50).borderRadius(10)
.backgroundColor(0xFFFFFF).padding({ left: 20 }) .backgroundColor(0xFFFFFF).padding({ left: 20 })
......
...@@ -4,9 +4,9 @@ The border attribute is used to set border styles for components. ...@@ -4,9 +4,9 @@ The border attribute is used to set border styles for components.
> **NOTE** > **NOTE**
> >
> The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
> >
> The border of a component is displayed above the content of its child components since API version 9. > The border of a component is displayed above the content of its child components since API version 9.
## Required Permissions ## Required Permissions
...@@ -16,21 +16,22 @@ None ...@@ -16,21 +16,22 @@ None
## Attributes ## Attributes
| Name| Type| Default Value| Description| | Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- | | ------------ | ------------- | ----------------------- | ------------------------ |
| border | BorderOptions | - | Unified border style.| | border | BorderOptions | - | Unified border style. |
| borderStyle | BorderStyle | BorderStyle.Solid | Border style of an element.| | borderStyle | BorderStyle | BorderStyle.Solid | Border style of an element.|
| borderWidth | Length | 0 | Border width of an element.| | borderWidth | Length | 0 | Border width of an element. |
| borderColor | [ResourceColor](../../ui/ts-types.md) | - | Border color of an element.| | borderColor | [ResourceColor](../../ui/ts-types.md) | - | Border color of an element. |
| borderRadius | Length | 0 | Border radius of an element.| | borderRadius | Length \| BorderRadiuses<sup>9+</sup> | 0 | Border radius of an element.|
- BorderOptions - BorderOptions
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- | | Name| Type | Default Value | Mandatory| Description |
| width | [Length](../../ui/ts-types.md) \| EdgeWidth<sup>9+</sup> | 0 | No| Border width.| | -------- | ------------------------------------------------------------ | ----------------- | ---- | ---------- |
| color | [ResourceColor](../../ui/ts-types.md) \|EdgeColor<sup>9+</sup> | 'Black' | No| Border color.| | width | [Length](../../ui/ts-types.md) \| EdgeWidth<sup>9+</sup> | 0 | No | Border width.|
| radius | [Length](../../ui/ts-types.md)\| EdgeRadiuses<sup>9+</sup> | 0 | No| Border radius.| | color | [ResourceColor](../../ui/ts-types.md) \| EdgeColor<sup>9+</sup> | 'Black' | No | Border color.|
| style | BorderStyle \| EdgeStyle<sup>9+</sup> | BorderStyle.Solid | No| Border style.| | radius | [Length](../../ui/ts-types.md) \| BorderRadiuses<sup>9+</sup> | 0 | No | Border radius.|
| style | BorderStyle \| EdgeStyle<sup>9+</sup> | BorderStyle.Solid | No | Border style.|
- EdgeWidth<sup>9+</sup> - EdgeWidth<sup>9+</sup>
...@@ -48,23 +49,24 @@ None ...@@ -48,23 +49,24 @@ None
To reference this object, at least one parameter must be passed. To reference this object, at least one parameter must be passed.
| Name | Type | Mandatory | Default Value | Description | | Name | Type | Mandatory| Default Value | Description |
| ------ | ------------------------------------- | --------- | ------------- | --------------------------- | | ------ | ------------------------------------- | ---- | ------- | -------------- |
| left | [ResourceColor](../../ui/ts-types.md) | No | 'Black' | Color of the left border. | | left | [ResourceColor](../../ui/ts-types.md) | No | 'Black' | Color of the left border.|
| right | [ResourceColor](../../ui/ts-types.md) | No | 'Black' | Color of the right border. | | right | [ResourceColor](../../ui/ts-types.md) | No | 'Black' | Color of the right border.|
| top | [ResourceColor](../../ui/ts-types.md) | No | 'Black' | Color of the top border. | | top | [ResourceColor](../../ui/ts-types.md) | No | 'Black' | Color of the top border.|
| bottom | [ResourceColor](../../ui/ts-types.md) | No | 'Black' | Color of the bottom border. | | bottom | [ResourceColor](../../ui/ts-types.md) | No | 'Black' | Color of the bottom border.|
- EdgeRadiuses<sup>9+</sup>
- BorderRadiuses<sup>9+</sup>
To reference this object, at least one parameter must be passed. To reference this object, at least one parameter must be passed.
| Name | Type| Mandatory| Default Value| Description | | Name | Type| Mandatory| Default Value| Description |
| ----------- | -------- | ---- | ------ | ---------------- | | ----------- | -------- | ---- | ------ | ---------------- |
| topLeft | length | No | 0 | Radius of the upper-left rounded corner.| | topLeft | length | No | 0 | Radius of the upper-left rounded corner.|
| topRight | length | No | 0 | Radius of the upper-right rounded corner.| | topRight | length | No | 0 | Radius of the upper-right rounded corner.|
| bottomLeft | length | No | 0 | Radius of the lower-left rounded corner.| | bottomLeft | length | No | 0 | Radius of the lower-left rounded corner.|
| bottomRight | length | No | 0 | Radius of the lower-right rounded corner.| | bottomRight | length | No | 0 | Radius of the lower-right rounded corner.|
- EdgeStyle<sup>9+</sup> - EdgeStyle<sup>9+</sup>
To reference this object, at least one parameter must be passed. To reference this object, at least one parameter must be passed.
......
# Focus Control # Focus Control
> **NOTE**<br> > **NOTE**
> The APIs of this module are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. >
> The APIs of this module are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions ## Required Permissions
...@@ -16,12 +17,14 @@ None ...@@ -16,12 +17,14 @@ None
| focusable | boolean | false | Whether the current component is focusable.| | focusable | boolean | false | Whether the current component is focusable.|
| tabIndex<sup>9+<sup> | number | 0 | How the current component participates in sequential keyboard navigation.<br>- **tabIndex** >= 0: The component is focusable in sequential keyboard navigation, with its order defined by the value. A component with a larger value is focused after one with a smaller value. If multiple components share the same **tabIndex** value, their focus order follows their position in the component tree.<br>- **tabIndex** < 0 (usually **tabIndex** = -1): The component is focusable, but cannot be reached through sequential keyboard navigation. | | tabIndex<sup>9+<sup> | number | 0 | How the current component participates in sequential keyboard navigation.<br>- **tabIndex** >= 0: The component is focusable in sequential keyboard navigation, with its order defined by the value. A component with a larger value is focused after one with a smaller value. If multiple components share the same **tabIndex** value, their focus order follows their position in the component tree.<br>- **tabIndex** < 0 (usually **tabIndex** = -1): The component is focusable, but cannot be reached through sequential keyboard navigation. |
> **NOTE**<br> > **NOTE**
> The following components support focus control: **\<Button>**, **\<Text>**, **\<Image>**, **\<List>**, and **\<Grid>**. >
> The following components support focus control: **\<Button>**, **\<Text>**, **\<Image>**, **\<List>**, and **\<Grid>**.
## Example ## Example
The effects of focus events can only be checked on real devices.
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
...@@ -66,3 +69,5 @@ struct FocusableExample { ...@@ -66,3 +69,5 @@ struct FocusableExample {
} }
} }
``` ```
![focus](figures/focus.png)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册