Explorar o código

[edit] update list

wenliming %!s(int64=2) %!d(string=hai) anos
pai
achega
206a3d8fb2
Modificáronse 1 ficheiros con 15 adicións e 1 borrados
  1. 15 1
      src/view/components/nft-group-list.vue

+ 15 - 1
src/view/components/nft-group-list.vue

@@ -42,7 +42,7 @@ const clickHandler = (item) => {
     emits('clickCallBack', item);
     emits('clickCallBack', item);
 }
 }
 
 
-onBeforeMount(() => {
+const getDetail = () => {
     listJoinNftGroup({
     listJoinNftGroup({
         params: {
         params: {
             pageNum,
             pageNum,
@@ -56,6 +56,20 @@ onBeforeMount(() => {
             emits('updateList', data);
             emits('updateList', data);
         }
         }
     })
     })
+}
+
+const onPageVisbile = () => {
+    document.addEventListener('visibilitychange', function () {
+        let isHidden = document.hidden;
+        if (!isHidden) {
+            getDetail();
+        }
+    });
+}
+
+onBeforeMount(() => {
+    getDetail();
+    onPageVisbile();
 })
 })
 </script>
 </script>