Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  
  <div id="app">
    
   <button @click="show = !show">{{ btnLabel }}</button>
   <transition name="fade">
     <div v-if="show">
       <div class="alert alert-success" role="alert">
         <p>Lorem ipsum dolor sit amet, consectetur
           adipiscing elit. Morbi vel nisl a magna dignissim
           ultrices vel at turpis. Quisque pharetra magna vitae
           nunc congue, eu sagittis elit rhoncus.
         </p>
      </div>
     </div>
   </transition>
 </div>
  
  
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script>
</body>
</html>
 
.fade-enter-active, .fade-leave-active {
  transition: opacity .5s ease-in-out;
}
.fade-enter, .fade-leave-active {
  opacity: 0;
}
 
new Vue({
  el: '#app',
  data: {
    show: true
  },
  computed: {
    btnLabel: function () {
      return (!this.show) ? 'Show Text' : 'Hide Text'
    }
  }
})
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
hfalucaspro
0viewers