What does the following method mean?

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)
                })
        }
    }
}

the above method comes from a demo, on the Internet, but I don"t understand how it is executed. What do you mean?

Aug.24,2021

suggest ide/" rel=" nofollow noreferrer "> vuex

  • Vue+fetch+nodejs,session failure problem

    1. Package the vue project and publish it in node, and there is no problem with getting session. fetch let requestConfig = { credentials: include , method: type, headers: { Accept : application json , Content-Type : applic...

    Mar.17,2021
  • Can't fetch request under vue cli?

    topic description the following code is commonly used on the Internet for fetch.js sources of topics and their own ideas some problems encountered in the code with async and await requests related codes Please paste the code text below (do...

Menu