修改食谱展示

This commit is contained in:
huangdeliang
2021-03-09 18:26:48 +08:00
parent 032b4e8106
commit 7709c85cb0
7 changed files with 70 additions and 9 deletions

View File

@ -6,6 +6,7 @@ import tagsView from "./modules/tagsView";
import permission from "./modules/permission";
import settings from "./modules/settings";
import recipes from "./modules/recipes";
import recipesShow from "./modules/recipesShow";
import global from "./modules/global";
import getters from "./getters";
@ -21,6 +22,7 @@ const store = new Vuex.Store({
permission,
settings,
recipes,
recipesShow,
global
},
getters,

View File

@ -0,0 +1,33 @@
const oriState = {
recipes: {},
shoppingCart: {}
};
const mutations = {
updateStateData(state, payload) {
Object.keys(payload).forEach(key => {
state[key] = payload[key];
});
},
clean(state) {
Object.keys(oriState).forEach(key => {
state[key] = oriState[key];
});
}
};
const actions = {
async fetchFullRecipes({commit, dispatch},payload ) {
}
};
const getters = {};
export default {
namespaced: true,
state: Object.assign({}, oriState),
mutations,
actions,
getters
};