修改食谱展示
This commit is contained in:
@ -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,
|
||||
|
33
stdiet-ui/src/store/modules/recipesShow.js
Normal file
33
stdiet-ui/src/store/modules/recipesShow.js
Normal 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
|
||||
};
|
Reference in New Issue
Block a user