How to extend component options type definition? #5951
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
First, you should use You could move your module augmentation to its own // my-custom-options.d.ts
import { Store } from "./store"
declare module "vue" {
interface ComponentCustomOptions {
fetch?(store: Store): void
}
} // shims-vue.d.ts
declare module "*.vue" {
import type { DefineComponent } from "vue"
const component: DefineComponent<{}, {}, any>
export default component
} |
Beta Was this translation helpful? Give feedback.
-
https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties
|
Beta Was this translation helpful? Give feedback.
https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties