atst/js/components/checkbox_input.js
dandds fd1d0b527a Delete environments permission disabled by default in new app member form
It will be enabled when the user checks the "manage environments"
permission. This updates the Jinja and Vue checkbox input components so
that Vue can monitor the inpur state.
2019-04-30 14:43:23 -04:00

30 lines
442 B
JavaScript

import { emitEvent } from '../lib/emitters'
export default {
name: 'checkboxinput',
components: {
checkboxinput: this,
},
props: {
name: String,
initialChecked: Boolean,
},
data: function() {
return {
checked: this.initialChecked,
}
},
methods: {
onInput: function(e) {
emitEvent('field-change', this, {
value: e.target.checked,
name: this.name,
})
},
},
}