Create new template and form field
This commit is contained in:
44
js/components/forms/poc.js
Normal file
44
js/components/forms/poc.js
Normal 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
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user