lilei 2 năm trước cách đây
mục cha
commit
11611ebb23
2 tập tin đã thay đổi với 11 bổ sung1 xóa
  1. 1 1
      public/version.json
  2. 10 0
      src/App.vue

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1678756698116
+  "version": 1678758332612
 }

+ 10 - 0
src/App.vue

@@ -45,6 +45,16 @@ export default {
     window.addEventListener('visibilitychange',()=>{
       this.$store.state.app.visibilityState = document.visibilityState == 'visible'
     })
+    window.addEventListener('focus',(e)=>{
+      if(!this.$store.state.app.visibilityState){
+        this.$store.state.app.visibilityState = true
+      }
+    })
+    window.addEventListener('blur',(e)=>{
+      if(!this.$store.state.app.visibilityState){
+        this.$store.state.app.visibilityState = false
+      }
+    })
     this.$message.config({
       top: `100px`,
       duration: 3,