Jelajahi Sumber

标签页隐藏 mqtt没有更新数据

zhaobao 1 tahun lalu
induk
melakukan
4b6a9cf84d
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 5 0
      src/views/bigScreen/home/components/carPlateInfo.vue

+ 5 - 0
src/views/bigScreen/home/components/carPlateInfo.vue

@@ -49,6 +49,11 @@ export default {
       this.initMqtt({
         mqttResponse: this.mqttResponse
       })
+      document.addEventListener('visibilitychange', () => {
+        if (document.visibilityState === 'visible') {
+          window.location.reload()
+        }
+      })
     },
     reload() {
       getTransList().then((resp) => {