fix: remove listener on form unmount
This commit is contained in:
@@ -294,7 +294,10 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
emitter.on('error', msg => this.error = msg);
|
emitter.on('error', this.setError);
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
emitter.off('error', this.setError);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
@@ -311,7 +314,10 @@
|
|||||||
},
|
},
|
||||||
resetForm() {
|
resetForm() {
|
||||||
this.$el.reset();
|
this.$el.reset();
|
||||||
}
|
},
|
||||||
|
setError(msg) {
|
||||||
|
this.error = msg
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user