Browse Source

页面销毁时关闭sseSource

pull/80/head
panlinlin 4 years ago
parent
commit
deef511362
  1. 4
      web_src/src/components/UiHeader.vue

4
web_src/src/components/UiHeader.vue

@ -71,6 +71,10 @@ export default {
},
destroyed() {
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))
},
}

Loading…
Cancel
Save