JSFiddle - React, Tailwind, and code Playground

by federico_alfaro

HTML

<div id="myID">
  <button v-on:click="warn('Form cannot be submitted yet.', $event)" />
</div>

CSS

body {
  background: #20262E;
  padding: 20px;
  font-family: Helvetica;
}

#myID {
  background: #532325;
  border-radius: 40px;
  padding: 20px;
  transition: all 0.2s;
}

#myID3 {
  background: #235;
  border-radius: 40px;
  padding: 20px;
  transition: all 0.2s;
}

#myID2 {
  background: #aaaa;
  border-radius: 40px;
  padding: 20px;
  transition: all 0.2s;
}

li {
  margin: 8px 0;
}

h2 {
  font-weight: bold;
  margin-bottom: 15px;
}

del {
  color: rgba(0, 0, 0, 0.3);
}

Vue

var vm1 = new Vue({
  el: "#myID",
  data: {
    contador: 0
  },
  methods: {
    warn: function (message, event) {
      // now we have access to the native event
      alert(event)
      if (event) event.preventDefault()
      	alert(message)
    }
   },
});