1
0
mirror of synced 2025-02-05 08:39:23 +03:00
vue-formulario/src/FormulateInputMixin.js

34 lines
545 B
JavaScript
Raw Normal View History

/**
* Default base for input components.
*/
export default {
model: {
prop: 'formulateValue',
event: 'input'
},
props: {
context: {
type: Object,
required: true
},
formulateValue: {
type: [Object, Array, Boolean, String, Number],
default: ''
}
},
computed: {
type () {
return this.context.type
},
id () {
return this.context.id
},
attributes () {
return this.context.attributes || {}
},
hasValue () {
return !!this.model
}
}
}