# 禁用控制

名称

参数类型

默认值

描述

enabled

boolean

true

值为true表示组件可用,可响应点击等操作;值为false时,不响应点击等操作。

## 示例 ``` @Entry @Component struct EnabledExample { build() { Flex({ justifyContent: FlexAlign.SpaceAround }) { // 点击没有反应 Button('disable').enabled(false).backgroundColor(0x317aff).opacity(0.4) Button('enable').backgroundColor(0x317aff) } .width('100%') .padding({ top: 5 }) } } ``` ![](figures/enabled.gif)