rdv: fullcalendar vue: use store and add an event on date select

This commit is contained in:
nobohan
2021-07-21 13:59:31 +02:00
parent f508971b6a
commit 0585455bbe
2 changed files with 22 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ const store = createStore({
strict: debug,
state: {
activity: mapEntity(window.entity),
events: []
},
mutations: {
@@ -60,6 +61,11 @@ const store = createStore({
state.activity.users = state.activity.users.filter(user => user !== payload);
break;
};
},
// Calendar
onDateSelect(state, payload) {
console.log(payload)
state.events.push( {start: payload.start, end: payload.end})
}
},
actions: {
@@ -98,6 +104,12 @@ const store = createStore({
break;
};
commit('removePersonInvolved', payload);
},
// Calendar
onDateSelect({ commit }, payload) {
console.log('### action onDateSelect', payload);
commit('onDateSelect', payload);
}
}
});