1.4.6 • Published 7 years ago

uxcore-checkbox-group v1.4.6

Weekly downloads
52
License
MIT
Repository
github
Last release
7 years ago

uxcore-checkbox-group Dependency Status devDependency Status

TL;DR

uxcore-checkbox-group ui component for react ES5 support needed(like es5-shim)

setup develop environment

$ git clone https://github.com/uxcore/uxcore-checkbox-group
$ cd uxcore-checkbox-group
$ npm install
$ gulp server

Usage

let classnames = require('classnames');

let CheckboxGroup = require('../src');
let Item = CheckboxGroup.Item

class Demo extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            value: ["air"]
        }
    }

    handleChange(value) {
        this.setState({
            value: value
        })
    }

    render() {
        return (
            <div>
                <CheckboxGroup onChange={this.handleChange.bind(this)} value={this.state.value}>
                    <Item text="天空天空天空" value="air"
                        addon={
                        <Popover overlay={<div>提示</div>}>
                            <i className='kuma-icon kuma-icon-caution' style={{color: 'blue', fontSize: '12px', 'marginLeft': '3px'}} />
                        </Popover>
                        }
                    />
                    <Item text="<b>大海大海大海</b>" value="sea"/>
                    <Item text="陆地陆地陆地" value="land"/>
                    <Item text="飞机飞机飞机" value="plane"/>
                    <Item text="火车飞机飞机" value="train"/>

                </CheckboxGroup>
            </div>
        );
    }
};

module.exports = Demo;

demo

http://uxcore.github.io/

API

Props

CheckboxGroup

配置项类型必填默认值功能/备注
valuearrayrequired[]由 value 组成地数组,与 React 受限组件表现一致,选中项与 value 保持一致,数组中的值与 item 的 value 相对应
onChangefunctionrequired-与 React 受限组件表现一致,在 checkbox 群发生改变时触发,借此来更改 value
disabledbooleanoptionalfalse是否为 disable 状态

CheckboxItem

通过 CheckboxGroup.Item 取得。

配置项类型必填默认值功能/备注
textstringoptinal-checkbox 后面跟着的说明文字
valuestringrequired-checkbox 对应的值
disabledbooleanoptional-Item 是否为 disable 状态,具有比 Group 更高的优先级
addonsjsxoptional-显示在label后面的添加项,可以用作checkbox的tips
1.4.6

7 years ago

1.4.2

7 years ago

1.4.5

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.4

7 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.11

9 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago