2016-12-15 07:15:46 +00:00
|
|
|
# element-radio
|
|
|
|
> A element-radio 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-radio
|
2016-07-27 06:15:02 +00:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
```shell
|
2016-12-15 07:15:46 +00:00
|
|
|
npm i element-radio -D
|
2016-07-27 06:15:02 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
```javascript
|
|
|
|
import Vue from 'vue'
|
2016-12-15 07:15:46 +00:00
|
|
|
import ElRadio from 'element-radio'
|
2016-07-27 06:15:02 +00:00
|
|
|
import 'element-theme-default/dist/radio.css'
|
|
|
|
|
|
|
|
Vue.use(ElRadio)
|
|
|
|
```
|
|
|
|
|
|
|
|
or
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
import Vue from 'vue'
|
2016-12-15 07:15:46 +00:00
|
|
|
import { ElRadio } from 'element-radio'
|
|
|
|
import { RadioButton } from 'element-radio'
|
|
|
|
import { RadioGroup } from 'element-radio'
|
2016-07-27 06:15:02 +00:00
|
|
|
|
|
|
|
Vue.component('el-radio', ElRadio)
|
2016-12-15 07:15:46 +00:00
|
|
|
Vue.component('el-radio-button', RadioButton)
|
|
|
|
Vue.component('el-radio-group', RadioGroup)
|
2016-07-27 06:15:02 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
2016-12-15 07:15:46 +00:00
|
|
|
## Radio Attributes
|
2016-07-27 06:15:02 +00:00
|
|
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
|
|
|---------- |-------- |---------- |------------- |-------- |
|
2016-12-15 07:15:46 +00:00
|
|
|
| label | Radio 的 value | string,number | — | — |
|
|
|
|
| disabled | 是否禁用 | boolean | — | false |
|
|
|
|
| name | 原生 name 属性 | string | — | — |
|
|
|
|
|
|
|
|
## Radio-group Attributes
|
|
|
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
|
|
|---------- |-------- |---------- |------------- |-------- |
|
|
|
|
| size | Radio 按钮组尺寸 | string | large, small | — |
|
|
|
|
|
|
|
|
## Radio-group Events
|
|
|
|
| 事件名称 | 说明 | 回调参数 |
|
|
|
|
|---------- |-------- |---------- |
|
|
|
|
| change | 绑定值变化时触发的事件 | 选中的 Radio label 值 |
|
|
|
|
|
|
|
|
## Radio-button Attributes
|
|
|
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
|
|
|---------- |-------- |---------- |------------- |-------- |
|
|
|
|
| label | Radio 的 value | string,number | — | — |
|
|
|
|
| disabled | 是否禁用 | boolean | — | false |
|
|
|
|
| fill | 按钮激活时的填充色和边框色 | string | — | #20a0ff |
|
|
|
|
| text-color | 按钮激活时的文本颜色 | string | — | #ffffff |
|
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)
|