继承
FieldBase
用法
<div style={{ marginBottom: 20 }}>
<Label htmlFor="s1" style={{ width: 150 }}>Receive mail:</Label>
<SwitchButton inputId="s1" value={received} onChange={(value) => this.setState({ received: value })}></SwitchButton>
</div>
<div style={{ marginBottom: 20 }}>
<Label htmlFor="s2" style={{ width: 150 }}>Shared network:</Label>
<SwitchButton inputId="s2" value={shared} onChange={(value) => this.setState({ shared: value })}></SwitchButton>
</div>
<div style={{ marginBottom: 20 }}>
<Label htmlFor="s3" style={{ width: 150 }}>Subscribed:</Label>
<SwitchButton inputId="s3" value={subscribed} onChange={(value) => this.setState({ subscribed: value })}></SwitchButton>
</div>
属性
名称 | 类型 | 描述 | 默认 |
---|---|---|---|
value | boolean | 值绑定到按钮。 | null |
onText | string | 按钮状态为on时的文本值 | ON |
offText | string | 按钮关闭状态时的文本值。 | OFF |
handleText | string | 中心句柄的文本值。 | null |
disabled | boolean | 定义是否为禁用按钮。 | false |
readonly | boolean | 定义按钮是否只读。 | false |
inputId | string | 输入框的id属性值。 | null |