Skip to content

Instantly share code, notes, and snippets.

@mtov
Created October 12, 2019 10:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Simple Single Page Application (SPA) using Vue.js
<html>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<body>
<h3>Uma Simples SPA</h3>
<div id="ui">
Temperatura: {{ temperatura }}
<p><button v-on:click="incTemperatura">Incrementa</button></p>
</div>
<script>
var model = new Vue({
el: '#ui',
data: {
temperatura: 30
},
methods: {
incTemperatura: function () {
this.temperatura++;
}
}
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment