We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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.5.2
https://github.com/jiayexie/vue-typescript-declaration-repro
Build the project with npm run build. Build should pass.
npm run build
Uncomment the render function in error.ts and build again. Build fails because component type has changed and only has a 'message' prop on it.
Component type should be inferred from data, props, computed, methods, and be accessible in methods and render functions.
As soon as I add a render function, the type inference loses everything except props.
The text was updated successfully, but these errors were encountered:
This is because this type inference goes cyclic. Adding VNode return type to your render function would fix the problem.
this
VNode
render
import Vue, { VNode } from 'vue' Vue.extend({ // ... render(h): VNode { return h('div', this.message) } })
We will include this caveats in the docs.
Sorry, something went wrong.
I will make a pull request to vuejs.org.
HerringtonDarkholme
No branches or pull requests
Version
2.5.2
Reproduction link
https://github.com/jiayexie/vue-typescript-declaration-repro
Steps to reproduce
Build the project with
npm run build
. Build should pass.Uncomment the render function in error.ts and build again. Build fails because component type has changed and only has a 'message' prop on it.
What is expected?
Component type should be inferred from data, props, computed, methods, and be accessible in methods and render functions.
What is actually happening?
As soon as I add a render function, the type inference loses everything except props.
The text was updated successfully, but these errors were encountered: