minimize the rest of the sharedcomputedobject
This commit is contained in:
parent
ac32997f8b
commit
947b73f870
|
@ -1,18 +1,10 @@
|
||||||
import { defaultState as configDefaultState } from 'src/modules/config.js'
|
|
||||||
|
|
||||||
const SharedComputedObject = () => ({
|
const SharedComputedObject = () => ({
|
||||||
user () {
|
user () {
|
||||||
return this.$store.state.users.currentUser
|
return this.$store.state.users.currentUser
|
||||||
},
|
},
|
||||||
// Generating computed values for vuex properties
|
expertLevel () {
|
||||||
...Object.keys(configDefaultState)
|
return this.$store.getters.mergedConfig.expertLevel > 0
|
||||||
.map(key => [key, {
|
}
|
||||||
get () { return this.$store.getters.mergedConfig[key] },
|
|
||||||
set (value) {
|
|
||||||
this.$store.dispatch('setOption', { name: key, value })
|
|
||||||
}
|
|
||||||
}])
|
|
||||||
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export default SharedComputedObject
|
export default SharedComputedObject
|
||||||
|
|
Loading…
Reference in New Issue