Refactor emit field change into a utility function

This commit is contained in:
leigh-mil
2019-04-04 10:31:02 -04:00
parent 1aaf4421ab
commit 3f2beb44b2
6 changed files with 18 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
import MaskedInput, { conformToMask } from 'vue-text-mask'
import inputValidations from '../lib/input_validations'
import { formatDollars } from '../lib/dollars'
import { emitFieldChange } from '../lib/emitters'
export default {
name: 'textinput',
@@ -124,11 +125,10 @@ export default {
this.showValid = this.value != '' && valid
// Emit a change event
this.$root.$emit('field-change', {
emitFieldChange(this, {
value: this._rawValue(value),
valid,
name: this.name,
parent_uid: this.$parent._uid,
})
},