Closed kingyue737 closed 6 months ago
See also: https://vuejs.org/guide/typescript/options-api.html#augmenting-custom-options
"Note this is just an example - well-typed libraries like vue-router should automatically perform these augmentations in their own type definitions."
This is about ComponentCustomOptions
but the same applies to GlobalComponents
.
Until then (depending on the build tooling) an even easier approach to set it up in downstream projects is the following:
// file needs to be an actual module, so we need at least one import or export
export {}
declare module 'vue' {
interface GlobalComponents {
Portal: typeof import('portal-vue')['Portal']
PortalTarget: typeof import('portal-vue')['PortalTarget']
}
}
Closing as Vue 2 has reached EOL
Currently I need to add shims in all my projects to get intellisense and typecheck in template (powered by Volar):
Autocomplete and typecheck:
Is it possible to add built-in support in this package? However, only Vue 2.7 and
@vue/runtime-dom
haveDefineComponent
.