Use new checkboxinput for POC checkbox
This commit is contained in:
17
js/components/checkbox_input.js
Normal file
17
js/components/checkbox_input.js
Normal file
@@ -0,0 +1,17 @@
|
||||
export default {
|
||||
name: 'checkboxinput',
|
||||
|
||||
props: {
|
||||
name: String,
|
||||
},
|
||||
|
||||
methods: {
|
||||
onInput: function (e) {
|
||||
console.log(e)
|
||||
this.$root.$emit('field-change', {
|
||||
value: e.target.checked,
|
||||
name: this.name
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
import optionsinput from '../options_input'
|
||||
import textinput from '../text_input'
|
||||
import checkboxinput from '../checkbox_input'
|
||||
|
||||
export default {
|
||||
name: 'poc',
|
||||
@@ -7,6 +8,7 @@ export default {
|
||||
components: {
|
||||
optionsinput,
|
||||
textinput,
|
||||
checkboxinput,
|
||||
},
|
||||
|
||||
props: {
|
||||
@@ -18,7 +20,7 @@ export default {
|
||||
|
||||
data: function () {
|
||||
const {
|
||||
am_poc = 'no'
|
||||
am_poc = false
|
||||
} = this.initialData
|
||||
|
||||
return {
|
||||
@@ -30,12 +32,6 @@ export default {
|
||||
this.$root.$on('field-change', this.handleFieldChange)
|
||||
},
|
||||
|
||||
computed: {
|
||||
amPOC: function () {
|
||||
return this.am_poc === 'yes'
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleFieldChange: function (event) {
|
||||
const { value, name } = event
|
||||
|
Reference in New Issue
Block a user