-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.7.x] [typescript] Type augmentation does not work #12642
Comments
That's strange. In my production code this is indeed resolved, but in my minimal example: https://github.com/last-partizan/vue-examples/tree/692569fa503c0511cd10d771432222980b6afc49
Fixed by adding |
vue 2.7.14 still has this problem import Vue from 'vue'
// not working
declare module 'vue/types/vue' {
export interface Vue {
test(): void
}
export interface VueConstructor {
test(): void
}
}
// Here is my solutoin
// works with defineComponent()
declare module 'vue/types/v3-component-options' {
export interface MethodOptions {
test(): void
}
}
export {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
2.7.4
Reproduction link
github.com
Steps to reproduce
look at the example repo, or, install
vue@2.7.4
and add type augmentation:What is expected?
Expected no erros.
What is actually happening?
The text was updated successfully, but these errors were encountered: