Browse Source

feat: 添加 shims-uni.d.ts 文件,扩展 Vue 组件自定义选项类型

EvilDragon 3 months ago
parent
commit
fd17634545
2 changed files with 8 additions and 0 deletions
  1. 0 0
      packages/ui/tsconfig.json
  2. 8 0
      packages/ui/types/shims-uni.d.ts

+ 0 - 0
packages/ui/tsconfig.json


+ 8 - 0
packages/ui/types/shims-uni.d.ts

@@ -0,0 +1,8 @@
+/// <reference types='@dcloudio/types' />
+import 'vue'
+
+declare module '@vue/runtime-core' {
+  type Hooks = App.AppInstance & Page.PageInstance
+
+  interface ComponentCustomOptions extends Hooks {}
+}