Answers for "vue hide component"

1

vue hide

<!-- there are two cases: -->
<!-- do you wanna keep it in the dom? -->
<div v-show="someBoolean">
  v-show
</div>

<!-- or remove it -->
<div v-if="someBoolean">
  v-if
</div>
Posted by: Guest on October-20-2021
0

hide component on click vue

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>

<div id="app">
  <button v-on:click="isHidden = true">Hide the text below</button>
  <button v-on:click="isHidden = !isHidden">Toggle hide and show</button>

  <h1 v-if="!isHidden">Hide me on click event!</h1>
</div>

var app = new Vue({
  el: '#app',
  data: {
    isHidden: false
  }
})
Posted by: Guest on May-26-2020
-1

hide element vue

// to hide element in vue.js use v-if
  <div v-if="seen" id="hide">
      <p>hide me </p>
  </div>
</div>

new Vue({
data:{
    seen: true
}
});
Posted by: Guest on August-26-2021

Browse Popular Code Answers by Language