Thunberg087 / vue-fragment

a very candide fragment component for Vue.js
http://jsfiddle.net/cdkn5wL3/
670 stars 51 forks source link

v-show not working when component is wrapped with fragment #33

Open renielsalvador opened 4 years ago

renielsalvador commented 4 years ago

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

eliamartani commented 4 years ago

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.