按钮 Button

类型 #

按钮提供三种类型: 主按钮, 次按钮和透明按钮. 通过设置 type 属性为 primary ghost 可以分别设置为主按钮或幽灵(透明)按钮, 若不设置 type, 则该属性为次按钮.

尺寸 #

按钮有三种尺寸: 大号, 中号和小号. 通过设置 size 属性为 large small 可以分别设置为大号按钮或小号按钮, 若不设置 type, 则该属性为次按钮.

激活状态 #

通过设置 active 属性, 可以让按钮处于激活状态. 该特性通常与 ButtonGroup 配合使用.

禁用状态 #

通过设置 disabled 属性, 可以让按钮处于禁用状态. 禁用状态的按钮无法触发点击事件.

按钮组 #

<Button />放入<ButtonGroup />中可以实现按钮组.

API #

Button #

属性 描述 类型 默认值
type 类型 ["primary", "ghost"]
size 尺寸 ["small", "large"]
disabled 禁用 boolean false
active 激活 boolean false
block 块级显示 boolean false
onClick 点击事件 function