📝
Light
Copy
Run
<!DOCTYPE html> <html> <head> <title>VueJS Tutorial - Shorthand of the v-on: directive</title> </head> <body> <div id="myApp"> <!-- <button v-on:click="clickMe">Click Me</button> --> <button @click="clickMe">Click Me</button> </div> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <script> var myApp = new Vue({ el:'#myApp', methods:{ clickMe:function(){ alert('Hello from Vue.JS!'); } } }); </script> </body> </html>
Copied
╳
Editor Shortcuts
Ctrl + R =
Run Code
Ctrl + Space =
Show Hint