vue-mobx
Mobx binding for Vue.
Only supports Vuejs 2.x & Mobx 2.2.x or higher.
Installation
Install the pkg with npm:
npm install vue-mobx --save
or yarn
yarn add vue-mobx
or bower
bower install vue-mobx
Usage
Obviously it works with Mobx and Vuejs, install via NPM: npm i --save mobx vue vue-mobx
:
1. install vue-mobx plugin:
// entry.js;;; Vue;
2. create models:
// create models ; Class Test @observable count = 0; @actionbound { ++thiscount; } const test = ;;
3. use models in vue component:
// in vue component<template> <div> <p>count: count</p> <p @click="changeCount">Update</p> </div></template> <script> ; fromMobx: testModel </script>
There is a full example.
You can also hot-link the CDN version: https://unpkg.com/vue-mobx/dist/index.min.js, VueMobx
is exposed to window
object.
LICENSE
MIT