Parcourir la source

商城首页调试

skyblued il y a 2 ans
Parent
commit
5a172add76
2 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 2 2
      src/student/main.ts
  2. 4 0
      src/views/shop-mall/index.tsx

+ 2 - 2
src/student/main.ts

@@ -14,8 +14,8 @@ import { browser } from '@/helpers/utils'
 
 const app = createApp(App)
 
-// import Vconsole from 'vconsole'
-// const vconsole = new Vconsole()
+import Vconsole from 'vconsole'
+const vconsole = new Vconsole()
 postMessage(
   {
     api: 'getVersion'

+ 4 - 0
src/views/shop-mall/index.tsx

@@ -40,6 +40,10 @@ export default defineComponent({
   },
   mounted() {
     this.init()
+    document.addEventListener('visibilitychange', (event) => {
+      console.log(document.hidden,'显示')
+      getCartCount()
+    })
   },
   methods: {
     onSearch() {},