vue-fragment
vue-fragment copied to clipboard
v-show not working when component is wrapped with fragment
I have 2 components and each one is wrapped with fragment. Everything is working fine not until I used v-show in the component.
<template>
<FirstComponent v-show="true" />
<SecondComponent v-show="false" />
</template>
SecondComponent is supposed to be hidden.
It's not an issue:
The v-show prop when false add display: none; to the component.
If you're using <template> it will generate a div element and the prop will be attached to it.
However, you're trying to use <fragment> inside of child components and from my point of view this isn't the purpose of this plugin.
Conclusion: Use v-if instead or <template> if you really need v-show.