Browse Source

🎈 perf: 移除画中画

wolyshaw 3 years ago
parent
commit
5ecabfba45
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/components/live-broadcast/index.tsx

+ 4 - 4
src/components/live-broadcast/index.tsx

@@ -40,14 +40,14 @@ export default defineComponent({
     RuntimeUtils.loopSyncLike()
     event.on(LIVE_EVENT_MESSAGE['RC:Chatroom:Like'], this.onLikeMessage)
     window.onbeforeunload = this.beforeunload
-    window.addEventListener('focus', this.visibilitychange)
-    window.addEventListener('blur', this.visibilitychange)
+    // window.addEventListener('focus', this.visibilitychange)
+    // window.addEventListener('blur', this.visibilitychange)
   },
   beforeUnmount() {
     event.off(LIVE_EVENT_MESSAGE['RC:Chatroom:Like'], this.onLikeMessage)
     window.onbeforeunload = null
-    window.removeEventListener('focus', this.visibilitychange)
-    window.removeEventListener('blur', this.visibilitychange)
+    // window.removeEventListener('focus', this.visibilitychange)
+    // window.removeEventListener('blur', this.visibilitychange)
   },
   methods: {
     visibilitychange(evt: FocusEvent) {