minimize the rest of the sharedcomputedobject

このコミットが含まれているのは:
Henry Jameson 2023-03-12 16:55:39 +02:00
コミット 947b73f870
1個のファイルの変更3行の追加11行の削除

ファイルの表示

@ -1,18 +1,10 @@
import { defaultState as configDefaultState } from 'src/modules/config.js'
const SharedComputedObject = () => ({
user () {
return this.$store.state.users.currentUser
},
// Generating computed values for vuex properties
...Object.keys(configDefaultState)
.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 }), {})
expertLevel () {
return this.$store.getters.mergedConfig.expertLevel > 0
}
})
export default SharedComputedObject