Remove old field-mount and field-change emitters and listeners.
Replace FormMixin with new functionality.
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user