2019-10-07 10:24:30 -04:00
|
|
|
/**
|
|
|
|
* Default base for input components.
|
|
|
|
*/
|
|
|
|
export default {
|
2019-10-08 13:50:53 -04:00
|
|
|
model: {
|
|
|
|
prop: 'formulateValue',
|
|
|
|
event: 'input'
|
|
|
|
},
|
2019-10-07 10:24:30 -04:00
|
|
|
props: {
|
|
|
|
context: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
2019-10-08 13:50:53 -04:00
|
|
|
},
|
|
|
|
formulateValue: {
|
|
|
|
type: [Object, Array, Boolean, String, Number],
|
|
|
|
default: ''
|
2019-10-07 10:24:30 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
type () {
|
|
|
|
return this.context.type
|
|
|
|
},
|
|
|
|
id () {
|
|
|
|
return this.context.id
|
|
|
|
},
|
|
|
|
attributes () {
|
|
|
|
return this.context.attributes || {}
|
|
|
|
},
|
|
|
|
hasValue () {
|
2019-10-08 13:50:53 -04:00
|
|
|
return !!this.model
|
2019-10-07 10:24:30 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|