vue-base-demo
Version:
vue base demo
10 lines (8 loc) • 464 B
JavaScript
/**
* !!需要注意的一点:我们并不把 actions 放在模块里面,因为一个 action 可能需要触发影响多个模块的 mutations。
* 同时,actions 本来就应该和具体的状态以及 mutations 解耦。
*/
import {INCREMENT, DECREMENT} from '../modules/count'
// actions
export const increment = ({dispatch}, amount) => dispatch(INCREMENT, amount)
export const decrement = ({dispatch}, amount) => dispatch(DECREMENT, amount)