const titleCompetitionStore = {
namespaced: true,
state: () => ({
new_nested_comments: [],
}),
getters: {
},
mutations: {
SET_NEW_NESTED_COMMENTS_EMPTY(state) {
state.new_nested_comments = [];
},
},
actions: {
setNestedCommentList({ commit }) {
commit('SET_NEW_NESTED_COMMENTS_EMPTY');
},
},
};
export default titleCompetitionStore;
mutations에서 배열을 초기화하기위해서 빈 배열을 할당하였는데 계속해서 남아있는 문제가 있었다.
const titleCompetitionStore = {
namespaced: true,
state: () => ({
new_nested_comments: [],
}),
getters: {
},
mutations: {
SET_NEW_NESTED_COMMENTS_EMPTY(state) {
state.new_nested_comments.splice(0);
},
},
actions: {
setNestedCommentList({ commit }) {
commit('SET_NEW_NESTED_COMMENTS_EMPTY');
},
},
};
export default titleCompetitionStore;