Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

hide component on click vue

<script src="https://cdn.jsdelivr.net/npm/vue@2.5.13/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
  }
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #hide #component #click #vue
ADD COMMENT
Topic
Name
5+6 =