17 lines
333 B
JavaScript
17 lines
333 B
JavaScript
|
export const mapComputed = (root, updateFn, list) => {
|
||
|
const result = {};
|
||
|
list.forEach(key => {
|
||
|
result[key] = {
|
||
|
get() {
|
||
|
return this.$store.state[root][key];
|
||
|
},
|
||
|
set(value) {
|
||
|
this.$store.dispatch(updateFn, { [key]: value });
|
||
|
},
|
||
|
};
|
||
|
});
|
||
|
return result;
|
||
|
};
|
||
|
|
||
|
export default () => {};
|