Skip to content

Instantly share code, notes, and snippets.

@mtov
Last active January 17, 2024 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtov/ac1120c5b3e0a85d39bb7b05d20ee307 to your computer and use it in GitHub Desktop.
Save mtov/ac1120c5b3e0a85d39bb7b05d20ee307 to your computer and use it in GitHub Desktop.
Simple Single Page Application (SPA) using Vue.js
<html>
<script src="https://unpkg.com/vue@2"></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