- Store
- ChameleonStore.Store 实例方法
- Store.commit(type: string, payload?: any)
- Store.dispatch(type: string, payload?: any)
- Store.mapState(map: Array<string> | Object<string>): Object
- Store.mapGetters(map: Array<string> | Object<string>): Object
- Store.mapMutations(map: Array<string> | Object<string>): Object
- Store.mapActions(map: Array<string> | Object<string>): Object
- Store.registerModule(path: String, module: Module)
Store
通过 chameleon-store
创建的Store
实例,有以下方法:
ChameleonStore.createStore(options: Object): Object
Store构造器。详细介绍
ChameleonStore.Store 实例方法
Store.commit(type: string, payload?: any)
提交 mutation。详细介绍
Store.dispatch(type: string, payload?: any)
分发 action。详细介绍
Store.mapState(map: Array<string> | Object<string>): Object
为组件创建计算属性以返回 store 中的状态。详细介绍
Store.mapGetters(map: Array<string> | Object<string>): Object
为组件创建计算属性以返回 getter 的返回值。详细介绍
Store.mapMutations(map: Array<string> | Object<string>): Object
创建组件方法提交 mutation。详细介绍
Store.mapActions(map: Array<string> | Object<string>): Object
创建组件方法分发 action。详细介绍
Store.registerModule(path: String, module: Module)
注册一个动态模块。详细介绍