1.0.0 • Published 3 years ago

react-beautiful-radio v1.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
3 years ago

react-beautiful-radio

gras

DEMO示例地址:https://kafeihaoka.github.io/react-beautiful-radio/

安装依赖

npm i react-beautiful-radio -S

API 介绍

PropertyDescriptionTypeDefault
checked是否选中boolfalse
disabled是否禁用boolfalse
value描述文本string-
onClick点击事件function(e){}-

用法示例

import BeautyRadio from "react-beautiful-radio";

class RadioDemo extends React.Component {
      state = {
        checked : true
      };

    handleChange = () => {
        this.setState({
            checked: !this.state.checked
        })
    }

  render() {
    const { checked } = this.state;
    return (
      <div>
        <BeautyRadio
          checked={checked}
          value={'apple'}
          onClick={this.handleChange}
        />
      </div>
    );
  }
}

ReactDOM.render(<RadioDemo />, mountNode);

相关资料

  • react component radio react-beautiful-radio