页面销毁时关闭sseSource
This commit is contained in:
parent
157216a4da
commit
3168b90520
@ -71,6 +71,10 @@ export default {
|
|||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
window.removeEventListener('beforeunload', e => this.beforeunloadHandler(e))
|
window.removeEventListener('beforeunload', e => this.beforeunloadHandler(e))
|
||||||
|
this.sseSource.removeEventListener('open', null);
|
||||||
|
this.sseSource.removeEventListener('message', null);
|
||||||
|
this.sseSource.removeEventListener('error', null);
|
||||||
|
this.sseSource.close();
|
||||||
// window.removeEventListener('unload', e => this.unloadHandler(e))
|
// window.removeEventListener('unload', e => this.unloadHandler(e))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user