muse-model
对vuex功能的一个增强,简化了状态流程的写法。增加按需引入model的控制
安装
npm install muse-model
or
yarn add muse-model
快速上手
// model.js;;Vue; strict: true;
// main.js;; // model.js; ...App store;
;// count.js namespace: 'count' // 必须 state: count: 1 { return count: thisstatecount + 1 ; } { return count: thisstatecount - 1 ; } { this; return count: thisstatecount + 1 } { // 异步处理 return { ; }; };
+{{count}}-
Use Class Model
; state = count: 3 list: loading: false ; @action { return count: thisstatecount + 1 ; } @action { return count: thisstatecount - 1 ; } @action { this; return count: thisstatecount + num ; } @ @action { return { ; }; } @getter { return thisstatecount + 2; }
License
Copyright (c) 2018 myron