fix: 分类回显

fix-0609-xwk
向文可 2 years ago
parent 7d7fa4a629
commit cd11407ebd

@ -92,10 +92,19 @@ const actions = {
return res; return res;
}, },
load: async ({ state, commit }) => { load: async ({ state, commit }) => {
const deep = (arr) =>
arr.map((item) => {
return {
...item,
id: item.id + '',
childList: deep(item.childList || []),
};
});
commit('setOpts', { commit('setOpts', {
...state.opts, ...state.opts,
init: true, init: true,
category: await categoryAPI.search(), category: deep(await categoryAPI.search()),
}); });
}, },
detail: async (context, id) => { detail: async (context, id) => {

Loading…
Cancel
Save