Skip to content

Instantly share code, notes, and snippets.

@mtov mtov/vue.html

Created Oct 12, 2019
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
You can’t perform that action at this time.