Remove old field-mount and field-change emitters and listeners.

Replace FormMixin with new functionality.
This commit is contained in:
leigh-mil
2019-11-13 15:59:43 -05:00
parent 3576551f42
commit bc0382834b
9 changed files with 21 additions and 176 deletions

View File

@@ -1,6 +1,5 @@
import Vue from 'vue'
import { getDaysInMonth } from 'date-fns'
import { emitEvent } from '../lib/emitters'
let paddedNumber = function(number) {
if ((number + '').length === 1) {
@@ -37,14 +36,6 @@ export default {
}
},
created: function() {
emitEvent('field-mount', this, {
optional: this.optional,
name: this.name,
valid: this.isDateValid,
})
},
watch: {
month(newMonth, oldMonth) {
if (!!newMonth && newMonth.length > 2) {
@@ -217,13 +208,7 @@ export default {
},
methods: {
onInput: function(e) {
emitEvent('field-change', this, {
value: this.formattedDate,
name: this.name,
valid: this.isDateValid,
})
onInput: function() {
this.$parent.$emit('field-change', {
value: this.formattedDate,
name: this.name,