15.4.0
https://codesandbox.io/s/7yxprmx12j
<template functional>Expected to hide the child component
The child component is still shown, no CSS style added on the component
I'm posting on vue-loader specifically because of this issue: https://github.com/vuejs/vue/issues/8261
Thanks for your work :)
Sidenote: a raw tag in a field of this bug report page (<xxx>), without using backquotes, breaks the preview.
posted the same on vue forum a while back.
Never got any answer...
If you need to pass directives, you will have to write the functional component with a render function for the moment
This became a substantial problem with the newly introduced v-slot:foo / #foo syntax:
As component authors tend to rewrite their components with api compliancy, it is now impossible to rewrite a normal component as a functional SFC without breaking all usages of this component that have the new slot syntax assigned - which the component author can not control.
Just ran into the same issue ...
@arantes555 Me too right now...
I have the same issue. It seems like a big issue if you have a big app...
This bug is almost a year old and there's not even an official comment.
It requires me to write simple things
<ListItem>
<SomeComponent #icon />
<OtherComponent #head />
<ThirdComponent #footer />
</ListItem>
totally bloated
<ListItem>
<template #icon>
<SomeComponent />
</template>
<template #head>
<OtherComponent />
</template>
<template #footer>
<ThirdComponent />
</template>
</ListItem>
Because otherwise if in the future someone will rewrite SomeComponent, OtherComponent or ThirdComponent into a functional component, he will inevitably break this code. Without even knowing.
Also i can't add tooltips and other stuff that builds on top of directives to functional components 馃う鈥嶁檪
Could at least some core member please comment on this.
Is it just not going to happen?
Is it possible but i'd have to write a PR?
Is there some kind of bigger issue to this?
Same problem 馃憥馃徎
Workaround: use v-if instead of v-show.
Workaround: use
v-ifinstead ofv-show.
How is that meant to apply directives to functional components?
@econic the original report in this issue says :
A component with
A parent component including the previous component with v-show="false" directive
It's only afterwards that the problem was understood to be with all directives, not just v-show
To me as the issue's title says, it's about all directives with functional components and the steps to reproduce are just one example how to show this bug acutally exists.
I came from the issue https://github.com/vuejs/vue/issues/8261, that's why I think the workaround it's confusing.
Thanks for clarifying.
I still think it's time for the loader to handle directives generally...
Just came across this as well after re-writing several presentational/dumb components using the <template functional> notation, and having one of those wtf moments "why the hell did tooltips directive stopped working?"
Now i know (forked the issue's sandbox for sanity check)
Anyone has a clue on the cause or sensible workarounds for other than v-show situation?
_EDIT: workaround is to write render functions._
馃憖 鈽笍
"vue-loader": "15.8.3"
Most helpful comment
This bug is almost a year old and there's not even an official comment.
It requires me to write simple things
totally bloated
Because otherwise if in the future someone will rewrite
SomeComponent,OtherComponentorThirdComponentinto a functional component, he will inevitably break this code. Without even knowing.Also i can't add tooltips and other stuff that builds on top of directives to functional components 馃う鈥嶁檪
Could at least some core member please comment on this.
Is it just not going to happen?
Is it possible but i'd have to write a PR?
Is there some kind of bigger issue to this?