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
this
2.6.14
codesandbox.io
Comment the helloWorld method, then uncomment it. This will trigger the type checking.
helloWorld
You should now see this syntax error on serverPrefetch code:
methods, props and data properties should be available inside serverPrefetch's this type.
serverPrefetch's this is a generic Vue type that doesn't include current component info.
serverPrefetch
This seems to be a leftover. This issue was fixed for multiple ComponentOptions with this commit.
Then ssrPrefetch was added including the this: V type with this commit and further serverPrefetch kept it this commit.
ssrPrefetch
this: V
This type is not needed:
diff --git a/types/options.d.ts b/types/options.d.ts - serverPrefetch?(this: V): Promise<void>; + serverPrefetch?(): Promise<void>;
I got to this bug trying to use a Vuex mapped mutation inside serverPrefetch.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Version
2.6.14
Reproduction link
codesandbox.io
Steps to reproduce
Comment the
helloWorld
method, then uncomment it. This will trigger the type checking.You should now see this syntax error on serverPrefetch code:

What is expected?
methods, props and data properties should be available inside serverPrefetch's
this
type.What is actually happening?
serverPrefetch
'sthis
is a generic Vue type that doesn't include current component info.This seems to be a leftover. This issue was fixed for multiple ComponentOptions with this commit.
Then
ssrPrefetch
was added including thethis: V
type with this commit and furtherserverPrefetch
kept it this commit.This type is not needed:
I got to this bug trying to use a Vuex mapped mutation inside serverPrefetch.
The text was updated successfully, but these errors were encountered: