React collapsed button
git clone https://github.com/uxcore/uxcore-collapsed-button
cd uxcore-collapsed-button
npm install
npm run server
if you'd like to save your install time,you can use uxcore-tools globally.
npm install uxcore-tools -g
git clone https://github.com/uxcore/uxcore-collapsed-button
cd uxcore-collapsed-button
npm install
npm run dep
npm run start
npm run test
npm run coverage
http://uxcore.github.io/components/collapsed-button
Yes please! See the CONTRIBUTING for details.
Name | Type | Required | Default | Comments |
---|---|---|---|---|
type | string | - | '' | 触发下拉的元素的类型,默认是文字,‘button’是按钮 |
onClick | function | - | - | CollapsedButton.Item 的点击回调 |
maxLength | number | - | 3 | 超过 maxLength 将会变成下拉形式,否则平铺 |
import CollapsedButton from 'uxcore-collapsed-button';
handleClick() {}
render() {
return (
<CollapsedButton type="button">
<CollapsedButton.Item onClick={this.handleClick.bind(this)}>
按钮一
</CollapsedButton.Item>
<CollapsedButton.Item onClick={this.handleClick.bind(this)}>
按钮二
</CollapsedButton.Item>
<CollapsedButton.Item>
按钮三
</CollapsedButton.Item>
</CollapsedButton>
);
}