@afeefa/vue-app 0.0.78 → 0.0.79
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.79
|
package/package.json
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
:valid="valid"
|
10
10
|
:modelToEdit="modelToEdit"
|
11
11
|
:model="model"
|
12
|
+
:getField="getField"
|
12
13
|
/>
|
13
14
|
</v-form>
|
14
15
|
</template>
|
@@ -35,6 +36,15 @@ export default class EditForm extends Vue {
|
|
35
36
|
this.reset()
|
36
37
|
}
|
37
38
|
|
39
|
+
getField = name => {
|
40
|
+
const modelType = this.$apiResources.getType(this.model.type)
|
41
|
+
const update = !!this.model.id
|
42
|
+
const fields = update
|
43
|
+
? modelType.getUpdateFields()
|
44
|
+
: modelType.getCreateFields()
|
45
|
+
return fields[name]
|
46
|
+
}
|
47
|
+
|
38
48
|
forceUnchanged () {
|
39
49
|
this.forcedUnchange = true
|
40
50
|
this.$emit('update:changed', false)
|
@@ -8,11 +8,12 @@
|
|
8
8
|
:createModelToEdit="createModelToEdit"
|
9
9
|
v-on="$listeners"
|
10
10
|
>
|
11
|
-
<template #form="{modelToEdit, model, changed, valid}">
|
11
|
+
<template #form="{modelToEdit, model, getField, changed, valid}">
|
12
12
|
<slot
|
13
13
|
name="form"
|
14
14
|
:modelToEdit="modelToEdit"
|
15
15
|
:model="model"
|
16
|
+
:getField="getField"
|
16
17
|
:changed="changed"
|
17
18
|
:valid="valid"
|
18
19
|
/>
|