ITADN

How to reference global types

#68Openhairyf 创建于 2025-03-25
H
hairyfcommented
I added the following type: ```ts export {} declare module 'vue' { export interface GlobalComponents { MyButton: typeof import('./MyButton')['MyButton'] } } ``` When using it in a vue file, `my-button` is an undefined type unknown: ```vue <template> <my-button> Click </my-button> </template> ``` ``` <my-button> Click </my-button> ↑ type MyButton: unknown ```
0 条评论