element/packages/checkbox/README.md

61 lines
1.6 KiB
Markdown
Raw Normal View History

2016-12-15 07:15:46 +00:00
# element-checkbox
> A element-checkbox component for Vue.js.
2016-07-27 06:15:02 +00:00
## Demo
2016-12-15 07:15:46 +00:00
http://element-component.github.io/element-checkbox
2016-07-27 06:15:02 +00:00
## Installation
```shell
2016-12-15 07:15:46 +00:00
npm i element-checkbox -D
2016-07-27 06:15:02 +00:00
```
## Usage
```javascript
import Vue from 'vue'
2016-12-15 07:15:46 +00:00
import ElCheckbox from 'element-checkbox'
2016-07-27 06:15:02 +00:00
import 'element-theme-default/dist/checkbox.css'
Vue.use(ElCheckbox)
```
or
```javascript
import Vue from 'vue'
2016-12-15 07:15:46 +00:00
import { ElCheckbox } from 'element-checkbox'
import { ElCheckboxGroup } from 'element-checkbox'
2016-07-27 06:15:02 +00:00
Vue.component('el-checkbox', ElCheckbox)
2016-12-15 07:15:46 +00:00
Vue.component('el-checkbox-group', ElCheckboxGroup)
2016-07-27 06:15:02 +00:00
```
2016-12-15 07:15:46 +00:00
### Checkbox Attributes
2016-07-27 06:15:02 +00:00
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
2016-12-15 07:15:46 +00:00
| label | 选中状态的值(只有在`checkbox-group`或者绑定对象类型为`array`时有效)| string | — | — |
| true-label | 选中时的值 | string, number | — | — |
| false-label | 没有选中时的值 | string, number | — | — |
| name | 原生 name 属性 | string | — | — |
| disabled | 按钮禁用 | boolean | — | false |
| checked | 当前是否勾选 | boolean | — | false |
| indeterminate | 设置 indeterminate 状态,只负责样式控制 | boolean | — | false |
### Checkbox-group Events
| 事件名称 | 说明 | 回调参数 |
|---------- |-------- |---------- |
| change | 当绑定值变化时触发的事件 | event 事件对象 |
2016-07-27 06:15:02 +00:00
## Development
```shell
make dev
## test
make test
## build
make build
```
# License
[MIT](https://opensource.org/licenses/MIT)