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

update ts-basic-components-button.md

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 d5f9e715
# Button
The **\<Button>** component can be used to create different types of buttons.
> **NOTE**<br>
> **NOTE**
>
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
The **&lt;Button&gt;** component represents a component that can trigger actions.
## Required Permissions
None
......@@ -30,15 +29,15 @@ Supported
| stateEffect | boolean | No | true | Whether to enable the state switchover effect when a button is pressed. When the state is set to **false**, the state switchover effect is disabled. |
- Button(label?: string, options?: { type?: ButtonType, stateEffect?: boolean })
- Button(label?: [ResourceStr](../../ui/ts-types.md), options?: { type?: ButtonType, stateEffect?: boolean })
Creates a button component based on text content. In this case, the **&lt;Button&gt;** component cannot contain child components.
Creates a button component based on text content. In this case, the **\<Button>** component cannot contain child components.
**Table 2** value parameters
**Table 2** Parameters
| Name | Type | Mandatory | Default Value | Description |
| -------- | -------- | -------- | -------- | -------- |
| label | string | No | - | Button text. |
| label | [ResourceStr](../../ui/ts-types.md) | No | - | Button text. |
| options | Object | No | - | For details, see the **options** parameters. |
......@@ -67,7 +66,8 @@ Supported
## Example
```
```ts
// xxx.ets
@Entry
@Component
struct ButtonExample {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册