fix: remove listener on form unmount

This commit is contained in:
2018-09-06 18:16:34 -07:00
parent 50a3b1db92
commit 4591a47dba

View File

@@ -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
},
},
});