How to reference global types
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 条评论