Refactor emitters

This commit is contained in:
Montana
2019-04-19 11:33:51 -04:00
parent 39975a0a31
commit 629dd674b9
6 changed files with 22 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
import MaskedInput, { conformToMask } from 'vue-text-mask'
import inputValidations from '../lib/input_validations'
import { formatDollars } from '../lib/dollars'
import { emitFieldChange, emitFieldMount } from '../lib/emitters'
import { emitEvent } from '../lib/emitters'
export default {
name: 'textinput',
@@ -68,7 +68,7 @@ export default {
},
created: function() {
emitFieldMount(this, {
emitEvent('field-mount', this, {
optional: this.optional,
name: this.name,
})
@@ -126,7 +126,7 @@ export default {
this.showValid = this.value != '' && valid
// Emit a change event
emitFieldChange(this, {
emitEvent('field-change', this, {
value: this._rawValue(value),
valid,
name: this.name,