JSFiddle - React, Tailwind, and code Playground
by yyx990803
HTML
<script src="https://unpkg.com/vue"></script>
<div id="app"></div>
JavaScript
var counterStore = new Vue({
data: {
count: 0
},
methods: {
inc () { this.count++ },
dec () { this.count-- }
}
})
var vm = new Vue({
el: '#app',
render (h) {
return h('div', [
h('span', counterStore.count),
h('button', { on: { click: () => counterStore.inc() }}, '+'),
h('button', { on: { click: () => counterStore.dec() }}, '-')
])
}
})