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