Skip to content

Instantly share code, notes, and snippets.

@paveltimofeev
Created November 28, 2017 15:36
Show Gist options
  • Save paveltimofeev/89d7bcc9ed0da51b8f9559a1971009d2 to your computer and use it in GitHub Desktop.
Save paveltimofeev/89d7bcc9ed0da51b8f9559a1971009d2 to your computer and use it in GitHub Desktop.
VueJS Scaffolding
<html>
<head>
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app" v-on:click="sayHello('John', $event)">
{{ message }}
</div>
<br><small><i><a href="https://vuejs.org/v2/guide/">https://vuejs.org/v2/guide/</a></i></small>
</body>
<script>
var app = new Vue({
el: '#app',
data: {
message: 'Click on me!'
},
methods: {
sayHello: function( name ){
app.message = 'Hello, ' + name + ' ^.^ !';
}
}
})
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment