const state = { noticeItem: null }; const mutations = { SET_NOTICE_ITEM(state, item) { state.noticeItem = item; }, CLEAR_NOTICE_ITEM(state) { state.noticeItem = null; } }; const actions = {}; const getters = { getNoticeItem: (state) => state.noticeItem }; export default { namespaced: true, state, mutations, actions, getters };