Open renestalder opened 5 years ago
FYI: <template functional>
will be dropped in Vue v3.
https://github.com/vuejs/rfcs/pull/27
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:
Property 'props' does not exist
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
805