Removed all whole mess of manual watch/data declaration, now fully automatic
This commit is contained in:
parent
979e170bd6
commit
39b71e5dd6
4 changed files with 102 additions and 230 deletions
|
@ -1,5 +1,6 @@
|
|||
import { set } from 'vue'
|
||||
import { setPreset } from '../services/style_setter/style_setter.js'
|
||||
import { instanceDefaultProperties } from './config.js'
|
||||
|
||||
const defaultState = {
|
||||
// Stuff from static/config.json and apiConfig
|
||||
|
@ -72,6 +73,13 @@ const instance = {
|
|||
}
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
instanceDefaultConfig (state) {
|
||||
return instanceDefaultProperties
|
||||
.map(key => [key, state[key]])
|
||||
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setInstanceOption ({ commit, dispatch }, { name, value }) {
|
||||
commit('setInstanceOption', { name, value })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue