import * as types from '../type'
import api from '../../fetch/api
const actions = {
/**
* 获取约跑步列表
*/
getTravelsList({ commit }) {
if (state.scroll) {
commit(types.GET_TRAVELS_PAGE_NUM)
commit(types.COM_LOADING_STATUS, true),
commit(types.GET_TRAVELS_SCORLL_STATUS, false)
api.TravelsList()
.then(res => {
commit(types.COM_LOADING_STATUS, false),
commit(types.GET_TRAVELS_SCORLL_STATUS, true)
commit(types.GET_TRAVELS_LIST, res)
})
}
}
}
上面的方法来自网上的一个demo,但是我看不懂它是如何执行的,是什么意思?