Skip to content

Instantly share code, notes, and snippets.

@victorlucss
Created October 17, 2018 17:17
Show Gist options
  • Save victorlucss/b0c83b6aa83015a6782ed2f4b3d08adb to your computer and use it in GitHub Desktop.
Save victorlucss/b0c83b6aa83015a6782ed2f4b3d08adb to your computer and use it in GitHub Desktop.
<script src="https://unpkg.com/vue"></script>
<div id="app">
<titulo></titulo>
<h2>{{ count }}</h2>
<button v-on:click="incrementar">Adicionar um</button>
</div>
<script>
Vue.component('titulo', {
template: '<h1>Contador de cliques</h1>'
});
new Vue({
el: '#app',
data: {
count: 0
},
methods: {
incrementar () {
this.count += 1
}
},
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment