瀏覽代碼

Update index.tsx

lex 2 年之前
父節點
當前提交
18e5374657
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/views/shop-mall/components/TheHomeHeader/index.tsx

+ 4 - 2
src/views/shop-mall/components/TheHomeHeader/index.tsx

@@ -41,8 +41,10 @@ export default defineComponent({
 
     onMounted(() => {
       nextTick(() => {
-        const { height } = useRect(homeHeaderDom as any)
-        emit('headerDom', height)
+        setTimeout(() => {
+          const { height } = useRect(homeHeaderDom as any)
+          emit('headerDom', height)
+        }, 300)
       })
     })