33 lines
536 B
JavaScript
33 lines
536 B
JavaScript
|
|
const state = {
|
||
|
|
meetings: []
|
||
|
|
}
|
||
|
|
|
||
|
|
const mutations = {
|
||
|
|
setMeetings(state, meetings) {
|
||
|
|
state.meetings = meetings
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const actions = {
|
||
|
|
fetchMeetings({ commit }) {
|
||
|
|
// 模拟API调用
|
||
|
|
const meetings = [
|
||
|
|
{ id: 1, title: 'Meeting 1' },
|
||
|
|
{ id: 2, title: 'Meeting 2' }
|
||
|
|
]
|
||
|
|
commit('setMeetings', meetings)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const getters = {
|
||
|
|
allMeetings: state => state.meetings
|
||
|
|
}
|
||
|
|
|
||
|
|
export default {
|
||
|
|
namespaced: true,
|
||
|
|
state,
|
||
|
|
mutations,
|
||
|
|
actions,
|
||
|
|
getters
|
||
|
|
}
|