import React from 'react' import classNames from 'classnames' import './index.less' var Switch = React.createClass({ getInitialState(){ return { checked: !!this.props.checked } }, changeEv(e){ this.setState({ checked: !this.state.checked }) this.props.onChange && this.props.onChange(!this.state.checked); }, render(){ let { label, disabled, checked, children, className, ...others } = this.props; const cls = classNames('weui-cell weui-cell_switch', { [className]: className }); return(