Explorar el Código

fix:修改ToolFun文件添加类型

zlong hace 1 año
padre
commit
091485d3ec
Se han modificado 5 ficheros con 14 adiciones y 14 borrados
  1. 2 2
      src/auto-imports.d.ts
  2. 1 1
      src/pages.json
  3. 1 1
      src/pages/feed-plan/index.vue
  4. 0 10
      src/utils/index.js
  5. 10 0
      src/utils/index.ts

+ 2 - 2
src/auto-imports.d.ts

@@ -293,7 +293,7 @@ declare global {
   const useWindowFocus: typeof import('@vueuse/core')['useWindowFocus']
   const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll']
   const useWindowSize: typeof import('@vueuse/core')['useWindowSize']
-  const utils: typeof import('./utils/index.js')['default']
+  const utils: typeof import('./utils/index')['default']
   const watch: typeof import('vue')['watch']
   const watchArray: typeof import('@vueuse/core')['watchArray']
   const watchAtMost: typeof import('@vueuse/core')['watchAtMost']
@@ -609,7 +609,7 @@ declare module 'vue' {
     readonly useWindowFocus: UnwrapRef<typeof import('@vueuse/core')['useWindowFocus']>
     readonly useWindowScroll: UnwrapRef<typeof import('@vueuse/core')['useWindowScroll']>
     readonly useWindowSize: UnwrapRef<typeof import('@vueuse/core')['useWindowSize']>
-    readonly utils: UnwrapRef<typeof import('./utils/index.js')['default']>
+    readonly utils: UnwrapRef<typeof import('./utils/index')['default']>
     readonly watch: UnwrapRef<typeof import('vue')['watch']>
     readonly watchArray: UnwrapRef<typeof import('@vueuse/core')['watchArray']>
     readonly watchAtMost: UnwrapRef<typeof import('@vueuse/core')['watchAtMost']>

+ 1 - 1
src/pages.json

@@ -34,4 +34,4 @@
     "navigationStyle": "custom"
   },
   "subPackages": []
-}
+}

+ 1 - 1
src/pages/feed-plan/index.vue

@@ -3,7 +3,7 @@
 import bg from '@/static/image/feed-plan/bg.png'
 import circle from '@/static/image/feed-plan/circle.png'
 import message from '@/static/image/feed-plan/message.png'
-import ToolFun from '@/utils'
+import ToolFun from '@/utils/index'
 
 interface ListItem {
   img: string

+ 0 - 10
src/utils/index.js

@@ -1,10 +0,0 @@
-class ToolFun {
-  static getSafeHeight() {
-    const systemInfo = uni.getSystemInfoSync()
-    const safeAreaInsetBottom = systemInfo.safeAreaInsets.bottom + systemInfo.safeAreaInsets.top
-    const menuButtonInfoHeight = uni.getMenuButtonBoundingClientRect().height + 60
-    return safeAreaInsetBottom + menuButtonInfoHeight
-  }
-}
-
-export default ToolFun

+ 10 - 0
src/utils/index.ts

@@ -0,0 +1,10 @@
+class ToolFun {
+  static getSafeHeight(): number {
+    const systemInfo: UniApp.GetSystemInfoResult = uni.getSystemInfoSync()
+    const safeAreaInsetBottom: number = systemInfo.safeAreaInsets.bottom + systemInfo.safeAreaInsets.top
+    const menuButtonInfoHeight: number = uni.getMenuButtonBoundingClientRect().height + 60
+    return safeAreaInsetBottom + menuButtonInfoHeight
+  }
+}
+
+export default ToolFun