Use new checkboxinput for POC checkbox

This commit is contained in:
richard-dds
2018-08-14 20:47:36 -04:00
parent 4085c42c1c
commit 932922cfe6
7 changed files with 32 additions and 37 deletions

View 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
})
}
}
}

View File

@@ -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

View File

@@ -4,6 +4,7 @@ import VTooltip from 'v-tooltip'
import optionsinput from './components/options_input'
import textinput from './components/text_input'
import checkboxinput from './components/checkbox_input'
import DetailsOfUse from './components/forms/details_of_use'
import poc from './components/forms/poc'
@@ -15,6 +16,7 @@ const app = new Vue({
components: {
optionsinput,
textinput,
checkboxinput,
DetailsOfUse,
poc,
},