Skip to content

Commit

Permalink
#551 - added "is-disabled" class to the radios label
Browse files Browse the repository at this point in the history
  • Loading branch information
zoul0813 committed Dec 20, 2018
1 parent 8c6c7eb commit 1e9db8e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/fields/core/fieldRadios.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template lang="pug">
.radio-list(:disabled="disabled", v-attributes="'wrapper'")
label(v-for="item in items", :class="{'is-checked': isItemChecked(item)}", v-attributes="'label'")
label(v-for="item in items", :class="getItemCssClasses(item)", v-attributes="'label'")
input(:id="getFieldID(schema, true)", type="radio", :disabled="isItemDisabled(item)", :name="id", @click="onSelection(item)", :value="getItemValue(item)", :checked="isItemChecked(item)", :class="schema.fieldClasses", :required="schema.required", v-attributes="'input'")
| {{ getItemName(item) }}

Expand Down Expand Up @@ -58,6 +58,12 @@ export default {
return item;
}
},
getItemCssClasses(item) {
return {
"is-checked": this.isItemChecked(item),
"is-disabled": this.isItemDisabled(item)
};
},
onSelection(item) {
this.value = this.getItemValue(item);
},
Expand Down

0 comments on commit 1e9db8e

Please sign in to comment.