2.0.7 • Published 4 years ago

bee-switch v2.0.7

Weekly downloads
111
License
MIT
Repository
github
Last release
4 years ago

bee-switch

npm version Build Status Coverage Status dependencies Status NPM downloads Average time to resolve an issue Percentage of issues still open

两种状态切换的开关

使用

使用单独的switch包

组件引入

先进行下载switch包

npm install --save bee-switch

组件调用

import { Switch } from 'bee-switch';
React.render(<div>
            <Switch />
        </div>, document.getElementById('target'));

样式引入

  • 可以使用link引入dist目录下switch.css
<link rel="stylesheet" href="./node_modules/build/bee-switch.css">
  • 可以在js中import样式
import "./node_modules/src/Switch.scss"
//或是
import "./node_modules/build/bee-switch.css"

API

参数说明类型默认值
checked指定当前是否选中Booleanfalse
defaultChecked初始是否选中Booleanfalse
onChange变化时回调函数,自定义参照demoFunction(checked:Boolean)
disabled设置是否禁用Booleanfalse
checkedChildren选中时的内容ReactNode
unCheckedChildren非选中时的内容ReactNode
size大小设置,oneOf:sm, lgstring''
colors颜色设置,oneOf:primary,success,info,dark,warningstring''
onKeyDown键盘回调Function-
enterKeyDown是否启用 enter 和 space 键Booleantrue

setup develop environment

$ git clone https://github.com/tinper-bee/bee-switch
$ cd bee-switch
$ npm install
$ npm run dev
2.0.7

4 years ago

2.0.6

5 years ago

2.0.6-alpha.0

5 years ago

2.0.5

5 years ago

2.0.5-alpha.1

5 years ago

2.0.5-alpha.0

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.1.4

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.4

8 years ago