Remove other events emitted from root
This commit is contained in:
parent
04b9250ea1
commit
a6a908ae55
@ -1,4 +1,4 @@
|
|||||||
import { emitFieldChange, emitEvent } from '../lib/emitters'
|
import { emitFieldChange } from '../lib/emitters'
|
||||||
import optionsinput from './options_input'
|
import optionsinput from './options_input'
|
||||||
import textinput from './text_input'
|
import textinput from './text_input'
|
||||||
import clindollaramount from './clin_dollar_amount'
|
import clindollaramount from './clin_dollar_amount'
|
||||||
@ -61,23 +61,7 @@ export default {
|
|||||||
this.validateFunding()
|
this.validateFunding()
|
||||||
},
|
},
|
||||||
|
|
||||||
created: function() {
|
|
||||||
emitEvent('clin-change', this, {
|
|
||||||
id: this._uid,
|
|
||||||
obligatedAmount: this.initialObligated,
|
|
||||||
totalAmount: this.initialTotal,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
clinChangeEvent: function() {
|
|
||||||
emitEvent('clin-change', this, {
|
|
||||||
id: this._uid,
|
|
||||||
obligatedAmount: this.initialObligated,
|
|
||||||
totalAmount: this.initialTotal,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
checkFundingValid: function() {
|
checkFundingValid: function() {
|
||||||
return this.obligatedAmount <= this.totalAmount
|
return this.obligatedAmount <= this.totalAmount
|
||||||
},
|
},
|
||||||
@ -103,7 +87,7 @@ export default {
|
|||||||
|
|
||||||
removeClin: function() {
|
removeClin: function() {
|
||||||
this.showClin = false
|
this.showClin = false
|
||||||
emitEvent('remove-clin', this, {
|
this.$parent.$emit('remove-clin', this, {
|
||||||
clinIndex: this.clinIndex,
|
clinIndex: this.clinIndex,
|
||||||
})
|
})
|
||||||
this.removed = true
|
this.removed = true
|
||||||
|
@ -36,7 +36,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
this.$root.$on('remove-clin', this.handleRemoveClin)
|
this.$on('remove-clin', this.handleRemoveClin)
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
export const emitEvent = (event_type, el, data) => {
|
|
||||||
el.$root.$emit(event_type, {
|
|
||||||
...data,
|
|
||||||
parent_uid: el.$parent && el.$parent._uid,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const emitFieldChange = (el, data = null) => {
|
export const emitFieldChange = (el, data = null) => {
|
||||||
el.$parent.$emit('field-change', data)
|
el.$parent.$emit('field-change', data)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user