@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.
|
1
|
+
0.0.63
|
package/README.md
CHANGED
package/package.json
CHANGED
@@ -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>
|