question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v-show doesn't seem to work

See original GitHub issue

This doesn’t work as expected for me:

<template>
  <view>
    <text v-show="false">Hide this</text>
  </view>
</template>

i.e. The “Hide this” text still shows up.

Also, the code example for v-show in the Vue Native documentation actually uses v-if: https://vue-native.io/docs/conditional.html#v-show

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
jbarba4commented, May 30, 2021

For what it’s worth, I ran into this problem when attempting to use v-show to control the output of a child component that did NOT have a single top-level element. Wrapping the child component elements in a div gave me the expected behavior with v-show.

2reactions
RohanTalipcommented, Jun 7, 2019

Also the documentation for v-show has this text: “v-show keeps the element on the View, and only adjusts the opacity to 0%, or transparent”.

It might be better to toggle between display: 'flex' and display: 'none' in the style for a component, rather than changing the opacity of the view, i.e. similar to how v-show in Vue.js works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

v-show doesn't work as expected - Stack Overflow
I found a specific solution for your example, where it can only be one selected item, feel free to adapt it. let vm...
Read more >
What is the difference between v-show and v-if in Vue js
Both v-if and v-show are used to hide/display components, but in this article we are going to cover the details of when to...
Read more >
v-if vs. v-show - Vue Conditional Rendering - LearnVue
In this tutorial, we'll take a look at what conditional rendering is, how v-if and v-show work, and when you should use each...
Read more >
Why The Halo TV Show Isn't Working - Game Informer
Somehow, even with all the trappings, this Halo series just doesn't feel like Halo. Warning: The following opinion piece includes SPOILERS ...
Read more >
VSCode plots wont show anymore anywhere - VS Code
The pane seems to have disappeared and I cant find how to get it back. ... Thanks for the vscodium link, but unfortunately...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found