ВШ
Size: a a a
ВШ
SM
GP
GP
const mutationAddItem = (state, item, payload) => {в такой синтаксис:
state.items[ item.id ] = item;
state.index.country_code[ item.attributes.country_code ] = state.index.country_code[ item.attributes.country_code ] || {};
state.index.country_code[ item.attributes.country_code ][ item.id ] = true;
};
state.index.country_code = {просто в этом случае получится что значение всегда будет одно, а нужно - добавить.
...state.index.country_code,
[ item.attributes.country_code ]: {
[ item.id ]: true,
},
};
GP
Vue.set( state.index.country_code, countryCode, state.index.country_code[ countryCode ] || {} );
Vue.set( state.index.country_code[ countryCode ], item.id, true );
W
АН
W
W
W
W
W
АН
АН
W
W
W
W
АН