-
Notifications
You must be signed in to change notification settings - Fork 0
switch
huangchengwen edited this page Apr 16, 2017
·
1 revision
Support WEB
Properties | Descrition | Type | Default |
---|---|---|---|
name | 文本域 | Sting | null |
disabled | 是否可切换 | bool | false |
onChange | 切换回调 | function | null |
import { Component } from 'react'
import Switch from '../../../packages/switch';
export default class DemoSwitch extends Component {
change1(e) {
console.log(e.target.checked)
}
render() {
return(
<div className="fm-list">
<div className="fm-list-header">switch 滑动开关</div>
<div className="fm-list-body">
<div className="fm-list-item">
<div className="fm-list-content">选中状态</div>
<Switch name="switch1" checked={true} onChange={this.change1.bind(this)}/>
</div>
<div className="fm-list-item">
<div className="fm-list-content">未选中状态</div>
<Switch name="switch2"/>
</div>
<div className="fm-list-item">
<div className="fm-list-content">禁用状态</div>
<Switch name="switch3" disabled={true}/>
</div>
</div>
</div>
);
}
}