list.js
858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
export const state = () => ({
listContents: [],
});
export const getters = {
getListContents: (state) => state.listContents,
};
export const actions = {
/* params는 page.js의 pageParams 프로퍼티 중 size, no, total을 제외한 것 */
fetchListContents(context, params) {
return new Promise((resolve, reject) => {
context.commit('CLEAR_LIST_DATA');
this.$axios.get('/api/schedule/list', {
params,
})
.then((r) => {
context.commit('SET_LIST_DATA', r.data);
resolve(r.data);
})
.catch((e) => {
console.log(e.response);
reject(e);
});
});
},
};
export const mutations = {
SET_LIST_DATA(state, payload) {
state.listContents = payload;
},
CLEAR_LIST_DATA(state) {
state.listContents = [];
},
N_MGR_LIST(state) {
},
};