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

6
js/lib/emitters.js Normal file
View File

@@ -0,0 +1,6 @@
export const emitFieldChange = (el, data) => {
el.$root.$emit('field-change', {
...data,
parent_uid: el.$parent && el.$parent._uid,
})
}