A Pen by Andy Dietz

Thumbnail
This awesome code was written by andydietz, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright andydietz ©

Technologies

  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>A Pen by  Andy Dietz</title>
  
  
  
  
  
</head>

<body>

  <div id='app'>
    <button @click='test' :disabled='true'>Disabled button test</button>
  <transition name='fade'>
    <div v-if="messageText !== ''">{{ messageText }}</div>
    </transition>
</div>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.13/vue.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.0.0-beta.3/polyfill.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/andydietz/a-pen-by-andy-dietz-OvgbaO */
const vm = new Vue({
  el: "#app",
  data: {
    messageText: ''
  },
  methods: {
    test() {
      this.messageText = 'Button Clicked';
      setTimeout(() => {
        this.messageText = '';
      }, 2000);
    },
  },
});

Comments