vue-fragment icon indicating copy to clipboard operation
vue-fragment copied to clipboard

v-show not working when component is wrapped with fragment

Open renielsalvador opened this issue 6 years ago • 1 comments

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.

Here's the link to the sandbox

renielsalvador avatar Sep 09 '19 05:09 renielsalvador

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.

eliamartani avatar Feb 18 '20 21:02 eliamartani