JSFiddle - React, Tailwind, and code Playground

by Andrew Bogdanov

HTML

<body>
<div id="app">    
     <h1>{{message}}</h1>
     {{sayHi()}}
     <h3>{{welcome}}</h3>
  </div>

  <script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
  <script>
    new Vue({
      el: '#app',
      data: {
        message: 'Hello Vue!'
      },
      methods:{
        sayHi: function () {
          var v = this;
          setTimeout(function () {
   			v.message = "Hi Vue!";
        }, 3000);
       }
     },
      computed: {
        welcome: function(){
          return this.message === "Hi Vue!" ? "Welcome to the page" : "";
        }
      }
    });
  </script>
</body>