-
-
Notifications
You must be signed in to change notification settings - Fork 596
Add support for functional components #1313
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
Comments
FYI: |
Interesting. Thanks for the link. It's on "Request for comment" so we cannot yet be sure it will be dropped but it's a fair point to say that one should rather prepare for v3. |
Yeah, in any cases I'll investigate how we can support it in Vetur. |
@ktsn I feel like that's a shot into the dark. It now seems pretty clear that functional templates are dropped. Only functional components created via scripts will be available, with the reason that there will be no real performance difference between non functional and functional. So, from my point view, that's not something that should be tackled at all and can be closed. |
This is very much needed IMHO, right now it just throws an error that:
Which is problematic, and in the way. At least a workaround would be workable. |
Info
Problem
If functional components are defined in Single File Components, one has to access the Vue instance differently than in the case of a non functional component.
For example,
$slots
is going to beslots()
.Vetur currently doesn't recognize if one is using functional components on a template.
Reproducible Case
.vue
component and add thefunctional
tag to the property.props.<propertyName>
or slots e.g.slots().default
. The build will work and the app will work in run time. But Vetur shows an error.Additional information:
Similar issues
The text was updated successfully, but these errors were encountered: