atst/js/components/checkbox_input.js
leigh-mil bc0382834b Remove old field-mount and field-change emitters and listeners.
Replace FormMixin with new functionality.
2019-11-19 14:49:11 -05:00

28 lines
404 B
JavaScript

export default {
name: 'checkboxinput',
props: {
name: String,
initialChecked: Boolean,
optional: Boolean,
},
data: function() {
return {
isChecked: this.initialChecked,
}
},
methods: {
onInput: function() {
this.$parent.$emit('field-change')
},
},
computed: {
valid: function() {
return this.optional || this.isChecked
},
},
}