Commit 842977fb authored by Julien BOUYER's avatar Julien BOUYER
Browse files

UNOTOPLYS-166 feat(screen) : gestion des stores

parent 9bf8ead9
import { Module } from 'vuex';
import FormService from '@/entities/form/form.service';
const formService = new FormService();
export const formStore: Module<any, any> = {
state: {
idForm: 0,
form: null,
screenList: [],
},
getters: {
idForm: state => state.idForm,
form: state => state.form,
screenList: state => state.screenList,
},
actions: {},
mutations: {
......@@ -17,5 +22,8 @@ export const formStore: Module<any, any> = {
setForm(state, form) {
state.form = form;
},
setScreenList(state, screenList) {
state.screenList = screenList;
},
},
};
......@@ -3,19 +3,14 @@ import { Module } from 'vuex';
export const screenStore: Module<any, any> = {
state: {
screen: null,
screenList: [],
},
getters: {
screen: state => state.screen,
screenList: state => state.screenList,
},
actions: {},
mutations: {
setScreen(state, screen) {
state.screen = screen;
},
setScreenList(state, screenList) {
state.screenList = screenList;
},
},
};
......@@ -20,7 +20,7 @@ export default class FormEdit extends Vue {
beforeRouteEnter(to, from, next) {
next(vm => {
vm.$store.commit('setIdWorkspace', to.params.idWorkspace);
vm.$store.commit('setIdForm', to.params.idForm);
vm.$store.commit('setIdForm', to.params.idForm); // dispatch screenList sur une nouvelle action du store form
});
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment