浏览代码

我的页面初始化

seimin 11 月之前
父节点
当前提交
37c4593149
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 11 2
      pages/my/my.vue

+ 11 - 2
pages/my/my.vue

@@ -53,7 +53,7 @@
53
 
53
 
54
 <script setup>
54
 <script setup>
55
   import { ref, reactive } from 'vue'
55
   import { ref, reactive } from 'vue'
56
-  import { onLoad } from '@dcloudio/uni-app'
56
+  import { onLoad, onTabItemTap } from '@dcloudio/uni-app'
57
   import { api_incident_count } from "@/http/api.js"
57
   import { api_incident_count } from "@/http/api.js"
58
   import { defaultColor } from '@/static/js/theme.js'
58
   import { defaultColor } from '@/static/js/theme.js'
59
   import { useSetTitle } from '@/share/useSetTitle.js'
59
   import { useSetTitle } from '@/share/useSetTitle.js'
@@ -139,8 +139,17 @@
139
     })
139
     })
140
   }
140
   }
141
   
141
   
142
-  onLoad((option) => {
142
+  // 初始化
143
+  function onLoadFn(){
143
     getCount();
144
     getCount();
145
+  }
146
+  
147
+  onLoad((option) => {
148
+    onLoadFn();
149
+  })
150
+  
151
+  onTabItemTap(e => {
152
+    onLoadFn();
144
   })
153
   })
145
 </script>
154
 </script>
146
 
155