JSFiddle - React, Tailwind, and code Playground

by Nihar Raote

HTML

<script src="https://unpkg.com/vue@next"></script>
<div id="app">
  <button @click="showAlert">
    Click here
  </button>

  <input @keyup="changeThis" />
  {{ changeThisOutput }}
  <br/><br/>

  <input @keydown.ctrl="changeThat" />
  {{ changeThatOutput }}
</div>
<button>
  Click here too
</button>

Vue

const App = {
	data() {
  	return {
    	changeThisOutput: '',
      changeThatOutput: ''
    }
  },
  methods: {
  	showAlert() {
    	alert('This comes from a button click')
    },
    changeThis(e) {
    	this.changeThisOutput = e.target.value
    },
    changeThat(e) {
    	this.changeThatOutput = e.target.value
    }
  }
}

Vue.createApp(App).mount('#app')