diff options
author | Daniel Weipert <code@drogueronin.de> | 2021-06-22 00:18:35 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2021-06-22 00:18:35 +0200 |
commit | f6096a18016be63c719d2ce5a27d64363862b0fd (patch) | |
tree | fae30d63ff1ad2903236cab86d61cc4978f3dfe9 /app/src/mixins |
Initial commit
Diffstat (limited to 'app/src/mixins')
-rw-r--r-- | app/src/mixins/dynamicModelObjectEmit.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/src/mixins/dynamicModelObjectEmit.js b/app/src/mixins/dynamicModelObjectEmit.js new file mode 100644 index 0000000..93701c8 --- /dev/null +++ b/app/src/mixins/dynamicModelObjectEmit.js @@ -0,0 +1,16 @@ +export default { + props: { + modelValue: { + type: Object, + required: true, + }, + }, + + emits: ['update:modelValue'], + + methods: { + emit (key, value) { + this.$emit('update:modelValue', { ...this.modelValue, [key]: value }); + }, + }, +}; |