JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script>
<div id="app">
</div>
Babel + JSX
new Vue({
el: '#app',
template: `
<div>
<p>a: {{ a }}</p>
<p>b: {{ b }}</p>
<button @click="increment">+</button>
</div>
`,
data () {
return {
a: 1
}
},
computed: {
b () {
return this.a * 2
}
},
watch: {
a () {
console.log('a is changed')
}
},
methods: {
increment () {
this.a += 1
}
},
created () {
console.log(this.watchers)
}
})