-
-
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
Data properties not found and/or incorrectly typed in TypeScript 3.6.2 #10455
Comments
It's indeed not working anymore while it was on 3.5.3. Not sure if it's an upstream problem or not but something broke in our types |
I'm just looking into it. Still not sure whether it's upstream bug or not. But annotating data(this: any): { loading: boolean; fade: boolean } {
// ...
} |
I've filed it on TypeScript repo. |
TypeScript v3.6.3 has been released and it solves this issue. |
I'm still seeing this with TypeScript my workaround is to use for example watch:{
myVar(){
(this as Vue).myMethod()
}
} with a component definition (in the same file) like: declare module "vue/types/vue" {
interface Vue {
myMethod: () => void
}
} |
Version
2.6.10
Reproduction link
https://jsfiddle.net/keegan_openbay/nhvemx32/ (be aware that JSFiddle does not show TypeScript compiler errors)
Steps to reproduce
data
property in your component optionsWhat is expected?
Normal behavior; the
data
property is correctly typed and found on the instance.What is actually happening?
Errors arise because:
methods
, the data properties are not found on the component type.watch
, the data properties are typedstring | WatchOptionsWithHandler<any> | WatchHandler<any>
.computed
, the data properties are typed(() => any) | ComputedOptions<any>
.The text was updated successfully, but these errors were encountered: