platojs
Version:
Libraries of PLATO
31 lines (28 loc) • 492 B
JavaScript
export default {
props: {
value: {
default: ''
},
field: {
type: String,
default: ''
},
validate: {
type: Object,
default: null
}
},
methods: {
onChange (e) {
this.$emit('change', e.target.value)
}
},
created () {
if (this.validate && typeof this.$validate === 'function') {
this.$watch('value', () => {
// from 'platojs/plugins/validator/index.js
this.$validate()
})
}
}
}