ann0707
2018-08-16 c9bc8ec61cff4076132f6396d99d383a2cdf5a03
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
 * Created by c.y on 2018/3/20
 * Action 类似于 mutation,不同在于:
 * 1. Action 提交的是 mutation,而不是直接变更状态。
 * 2. Action 可以包含任意异步操作
 * 具体的配置可见 https://vuex.vuejs.org/zh-cn/actions.html
 */
 
// import {
//     UPDATE_COUNTS
// } from './mutation-types';
//
// const getUser = () => fetch('/v1/user', {user_id: getStore('user_id')});
//
// export default {
//     // 更新counts
//     async getUserInfo({commit, state}) {
//         let res = await getUser();
//         commit(UPDATE_COUNTS, res)
//     },
// };