@afeefa/vue-app 0.0.62 → 0.0.63

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.62
1
+ 0.0.63
package/README.md CHANGED
@@ -1 +1,3 @@
1
- # @afeefa/vue-app
1
+ # @afeefa/vue-app
2
+
3
+ Force push :-);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.62",
3
+ "version": "0.0.63",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -21,5 +21,9 @@ export default class NestedEditForm extends Vue {
21
21
  console.warn('Nested edit form does not have a model.')
22
22
  }
23
23
  }
24
+
25
+ get modelToEdit () {
26
+ return this.model
27
+ }
24
28
  }
25
29
  </script>
@@ -14,7 +14,7 @@
14
14
  <edit-form-buttons
15
15
  :changed="changed"
16
16
  :valid="valid"
17
- @save="$emit('save', model)"
17
+ @save="$emit('save', model, ignoreChangesOnRouteChange)"
18
18
  @reset="$refs.form.reset()"
19
19
  />
20
20
  </template>
@@ -30,10 +30,11 @@ import { DialogEvent } from '@a-vue/events'
30
30
  })
31
31
  export default class EditPage extends Vue {
32
32
  unregisterRouterHook = null
33
+ ignoreChangesOnRouteChange_ = false
33
34
 
34
35
  created () {
35
36
  this.unregisterRouterHook = this.$router.beforeEach(async (to, from, next) => {
36
- if (this.$refs.form.changed) {
37
+ if (this.$refs.form.changed && !this.ignoreChangesOnRouteChange_) {
37
38
  const result = await this.$events.dispatch(new DialogEvent(DialogEvent.SHOW, {
38
39
  title: 'Änderungen verwerfen?',
39
40
  message: 'Im Formular sind nicht gespeicherte Änderungen. Sollen diese verworfen werden?',
@@ -51,5 +52,9 @@ export default class EditPage extends Vue {
51
52
  destroyed () {
52
53
  this.unregisterRouterHook()
53
54
  }
55
+
56
+ ignoreChangesOnRouteChange () {
57
+ this.ignoreChangesOnRouteChange_ = true
58
+ }
54
59
  }
55
60
  </script>