Directives are not passed down to functional components with a template
See original GitHub issueVersion
15.4.0
Reproduction link
https://codesandbox.io/s/7yxprmx12j
Steps to reproduce
- A component with
<template functional>
- A parent component including the previous component with v-show=“false” directive
What is expected?
Expected to hide the child component
What is actually happening?
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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:21
- Comments:15 (1 by maintainers)
Top Results From Across the Web
What are the benefits of a directive template function in ...
directive ('myDirective', function(){ return { // Compile function acts on template DOM // This happens before it is bound to the scope, so...
Read more >Functional Components breaking - Vue 3 Migration Guide
The main differences are that: functional attribute removed on <template>; listeners are now passed as part of $attrs and can be ...
Read more >React Function Components
Essentially props in React are always passed down the component tree: import React from 'react';. function App() {.
Read more >Blade Templates - The PHP Framework For Web Artisans
Rendering Components; Passing Data To Components; Component Attributes ... Blade does not restrict you from using plain PHP code in your templates.
Read more >React for Vue developers - Sebastian De Deyne
However, we'll pass down a function instead of declaring a template. <!-- CurrentUser.vue --> <template> <span> <slot :user="user" /> </span> ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
,OtherComponent
orThirdComponent
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?
I have the same issue. It seems like a big issue if you have a big app…