Skip to content

Commit 622e5b6

Browse files
author
leihaohao
committed
refactor(core): 调整 TypeScript 类型声明的位置
- 将 Vue 组件自定义属性的类型声明从 index.ts 移动到 core.ts
1 parent 9997aa1 commit 622e5b6

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/core.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,9 @@ export function createPermission(options: PermissionOptions = {}): Permission {
6868
}
6969
return permission
7070
}
71+
72+
declare module 'vue' {
73+
interface ComponentCustomProperties {
74+
$permission: Permission
75+
}
76+
}

src/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
import type { Permission } from './core'
2-
31
export * from './component'
42
export * from './core'
53
export * from './directive'
64
export * from './injection'
7-
8-
declare module 'vue' {
9-
interface ComponentCustomProperties {
10-
$permission: Permission
11-
}
12-
}

0 commit comments

Comments
 (0)