Vue

by Lloyd Atkinson

HTML

<div id="app">
  <button @click="decide">
    Check
  </button>
</div>

Vue

new Vue({
  el: "#app",
  data: {
  	hasClicked: false,
  },
  methods: {
  	decide: function() {
    	if (!this.hasClicked) {
      	this,hasClicked = true;
        
      	this.firstFunction();
      } else {
      	this.secondFunction();
      }
    },
    firstFunction: function () {
    	alert('first');
    },
    secondFunction: function () {
    	alert('second');
    },
  }
})