$emit('change', {path: ['description'], value, ack})"
+ @change="change('description', ...arguments)"
/>
$emit('change', {path: ['baseValue'], value, ack})"
+ @change="change('baseValue', ...arguments)"
/>
{$emit('change', {path: ['baseProficiency'], value, ack})}"
+ @change="change('baseProficiency', ...arguments)"
/>
@@ -75,26 +69,14 @@
import ProficiencySelect from '/imports/ui/properties/forms/shared/ProficiencySelect.vue';
import FormSection from '/imports/ui/properties/forms/shared/FormSection.vue';
import createListOfProperties from '/imports/ui/properties/forms/shared/lists/createListOfProperties.js';
+ import propertyFormMixin from '/imports/ui/properties/forms/shared/propertyFormMixin.js';
export default {
components: {
ProficiencySelect,
FormSection,
},
- props: {
- model: {
- type: Object,
- default: () => ({}),
- },
- errors: {
- type: Object,
- default: () => ({}),
- },
- debounceTime: {
- type: Number,
- default: undefined,
- },
- },
+ mixins: [propertyFormMixin],
data(){return{
skillTypes: [
{
diff --git a/app/imports/ui/properties/forms/SpellForm.vue b/app/imports/ui/properties/forms/SpellForm.vue
index b0dec3a1..26216e88 100644
--- a/app/imports/ui/properties/forms/SpellForm.vue
+++ b/app/imports/ui/properties/forms/SpellForm.vue
@@ -4,8 +4,7 @@
label="Name"
:value="model.name"
:error-messages="errors.name"
- :debounce-time="debounceTime"
- @change="(value, ack) => $emit('change', {path: ['name'], value, ack})"
+ @change="change('name', ...arguments)"
/>
$emit('change', {path: ['level'], value, ack})"
+ @change="change('level', ...arguments)"
/>
$emit('change', {path: ['school'], value, ack})"
+ @change="change('school', ...arguments)"
/>
- $emit('change', {path: ['alwaysPrepared'], value: !!e})"
+ @change="change('alwaysPrepared', ...arguments)"
/>
$emit('change', {path: ['castingTime'], value, ack})"
+ @change="change('castingTime', ...arguments)"
/>
$emit('change', {path: ['range'], value, ack})"
+ @change="change('range', ...arguments)"
/>
- $emit('change', {path: ['verbal'], value})"
+ @change="change('verbal', ...arguments)"
/>
- $emit('change', {path: ['somatic'], value})"
+ @change="change('somatic', ...arguments)"
/>
- $emit('change', {path: ['concentration'], value})"
+ @change="change('concentration', ...arguments)"
/>
- $emit('change', {path: ['ritual'], value})"
+ @change="change('ritual', ...arguments)"
/>
$emit('change', {path: ['material'], value, ack})"
+ @change="change('material', ...arguments)"
/>
$emit('change', {path: ['duration'], value, ack})"
+ @change="change('duration', ...arguments)"
/>
$emit('change', {path: ['description'], value, ack})"
+ @change="change('description', ...arguments)"
/>
- $emit('change', {path: ['spellLists'], value})"
+ @change="change('spellLists', ...arguments)"
/>
import FormSection, { FormSections } from '/imports/ui/properties/forms/shared/FormSection.vue';
import ActionForm from '/imports/ui/properties/forms/ActionForm.vue'
+ import propertyFormMixin from '/imports/ui/properties/forms/shared/propertyFormMixin.js';
export default {
components: {
@@ -137,20 +129,7 @@
FormSection,
ActionForm,
},
- props: {
- model: {
- type: Object,
- default: () => ({}),
- },
- errors: {
- type: Object,
- default: () => ({}),
- },
- debounceTime: {
- type: Number,
- default: undefined,
- },
- },
+ mixins: [propertyFormMixin],
data(){return {
magicSchools: [
{
diff --git a/app/imports/ui/properties/forms/SpellListForm.vue b/app/imports/ui/properties/forms/SpellListForm.vue
index b6b414a9..f9f44511 100644
--- a/app/imports/ui/properties/forms/SpellListForm.vue
+++ b/app/imports/ui/properties/forms/SpellListForm.vue
@@ -5,45 +5,31 @@
label="Name"
:value="model.name"
:error-messages="errors.name"
- :debounce-time="debounceTime"
- @change="(value, ack) => $emit('change', {path: ['name'], value, ack})"
+ @change="change('name', ...arguments)"
/>
$emit('change', {path: ['description'], value, ack})"
+ @change="change('description', ...arguments)"
/>
$emit('change', {path: ['maxPrepared'], value, ack})"
+ @change="change('maxPrepared', ...arguments)"
/>