A decorator to make class properties reactive with Vue.js
MIT License
yarn add vue-observe
import observe from 'vue-observe'
class Store {
@observe count = 1
get double() {
return this.count * 2
}
inc() {
this.count++
}
}
const store = new Store()
// Your Vue.js app
new Vue({
render() {
return (
<button onClick={() => store.inc()}>
{store.count}:{store.double}
</button>
)
}
})
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
vue-observe © EGOIST, Released under the MIT License. Authored and maintained by EGOIST with help from contributors (list).
egoist.moe · GitHub @EGOIST · Twitter @_egoistlily