123456789101112131415161718192021222324252627282930313233343536373839404142 |
- const SET_PAGES = 'SET_PAGES';
- const SET_AD = 'SET_AD';
- const state = {
- loaded: false,
- data: undefined,
- ad: false,
- };
- const getters = {
- pages(state) {
- return state.data;
- },
- };
- const actions = {
- setPage({ commit }, pages) {
- console.log('setPage', pages);
- if (pages.main.adUrl) {
- commit(SET_AD, true);
- }
- commit(SET_PAGES, pages);
- },
- };
- const mutations = {
- [SET_PAGES](state, payload) {
- console.log('SET_PAGES', payload);
- state.loaded = true;
- state.data = payload;
- },
- [SET_AD](state, payload) {
- state.ad = payload;
- },
- };
- export default {
- state,
- getters,
- actions,
- mutations,
- };
|