-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
v-show on a component does not work when its template is just another component #1388
Comments
v-show works on dom elements, you're replacing it so it can't use display none etc. Try v-if instead. |
I'm replacing DOM here too, but it works in that case. |
A component that contains just another component makes the parent component a fragment instance, because the two components cannot share the same root node. In general you should avoid components that only contain another component - why would you do that in the first place? |
I have several object types that are displayed in a similar way. So my inner component handles presentation and several outer ones contain business logic specific for a particular type of object and pass data to the inner component instance. |
I'll add warning for this case in a future release. A simple solution is wrap your component with an outer element: <div v-show="condition">
<your-component></your-component>
</div> Or use |
Please see http://jsfiddle.net/5sH6A/176/
The text was updated successfully, but these errors were encountered: