Create new template and form field

This commit is contained in:
richard-dds
2018-08-14 12:54:48 -04:00
parent 5a2953ffc3
commit c6618c503b
7 changed files with 142 additions and 18 deletions

View File

@@ -0,0 +1,44 @@
import optionsinput from '../options_input'
import textinput from '../text_input'
export default {
name: 'poc',
components: {
optionsinput,
textinput,
},
props: {
initialData: {
type: Object,
default: () => ({})
}
},
data: function () {
return {
am_poc: "no"
}
},
mounted: function () {
this.$root.$on('field-change', this.handleFieldChange)
},
computed: {
amPOC: function () {
return this.am_poc === 'yes'
},
},
methods: {
handleFieldChange: function (event) {
const { value, name } = event
console.log(value, name)
if (typeof this[name] !== undefined) {
this[name] = value
}
},
}
}

View File

@@ -5,6 +5,7 @@ import VTooltip from 'v-tooltip'
import optionsinput from './components/options_input'
import textinput from './components/text_input'
import DetailsOfUse from './components/forms/details_of_use'
import poc from './components/forms/poc'
Vue.use(VTooltip)
@@ -15,6 +16,7 @@ const app = new Vue({
optionsinput,
textinput,
DetailsOfUse,
poc,
},
methods: {
closeModal: function(name) {