How to extend component options type definition? #5951
Answered
by
LinusBorg
b12k
asked this question in
Help/Questions
Answered by
LinusBorg
May 23, 2022
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
} |
2 replies
|
https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties
|
0 replies
Answer selected by
b12k
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties