Skip to content

Commit

Permalink
fix(radio): name prop is required
Browse files Browse the repository at this point in the history
fix #251
  • Loading branch information
stasson committed Feb 10, 2018
1 parent 63c7834 commit b6bdac7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions components/radio/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Usage

```html
<mdc-radio v-model="answer" label="Yes for sure" />
<mdc-radio v-model="answer" label="definitely NO!" />
<mdc-radio v-model="answer" label="I guess" checked />
<mdc-radio v-model="answer" name="radios" label="Yes for sure" />
<mdc-radio v-model="answer" name="radios" label="definitely NO!" />
<mdc-radio v-model="answer" name="radios" label="I guess" checked />

<p>Answer: {{ answer }}</p>
```
Expand All @@ -19,23 +19,25 @@ var vm = new Vue({
> or use default slot for label
```html
<mdc-radio v-model="answer">Yes for sure</mdc-radio>
<mdc-radio v-model="answer">definitely NO!</mdc-radio>
<mdc-radio v-model="answer" checked>"I guess"</mdc-radio>
<mdc-radio v-model="answer" name="radios">Yes for sure</mdc-radio>
<mdc-radio v-model="answer" name="radios">definitely NO!</mdc-radio>
<mdc-radio v-model="answer" name="radios"checked>"I guess"</mdc-radio>
```

### props

| props | Type | Default | Description |
|-------|------|---------|-------------|
|`name`|String || radio group name (__*__) |
|`label`| String|static| radio label |
|`align-end`| Boolean|| align the radio after the label |
|`name`|String|| radio group name |
|`value`|String| `label`| radio value, defaults to label value if any |
|`checked`|Boolean|| forces this radio to be selected. follows v-model otherwise |
|`:disabled`| Boolean|| whether the radio is disabled |
|`v-model`| String || tracks selected radio's value |

> (__*__) name prop is required for proper behavior.
### events

| event | args | Description |
Expand Down
2 changes: 1 addition & 1 deletion components/radio/mdc-radio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default {
event: 'change'
},
props: {
'name': String,
'name': {type: String, required: true},
'value': String,
'picked': String,
'checked': Boolean,
Expand Down

0 comments on commit b6bdac7

Please sign in to comment.