S
S
sergeyviktorovich2020-01-02 00:19:41
JavaScript
sergeyviktorovich, 2020-01-02 00:19:41

What happens in these lines in vue application?

what are these [SET_LOADER](state, payload) functions and how do they differ from the usual ones in terms of capabilities?

const mutations = {
    [SET_LOADER](state, payload) {
        state.loader = payload;
    },
    [SET_ERROR](state, payload) {
        state.error = payload;
    },
    [SET_DATALIST](state, payload) {
        state.dataList = payload;
    },
    [SET_CURRENT_ITEM](state, payload) {
        state.currentItem = payload;
    },
    [SET_DATAITEM_INFO](state, payload) {
        state.dataItemInfo = payload;
    },
    [SET_STEP](state, payload) {
        state.secondStep = payload;
    },
};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Makhov, 2020-01-02
@sergeyviktorovich

This is a member function whose name is a computed property: https://learn.javascript.ru/object#vychislyaemye-s...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question