forked from AkkomaGang/akkoma-fe
fix BooleanSetting and ChoiceSetting not working properly on initial
launch as anon visitor (would show all as changed, empty selects)
This commit is contained in:
parent
4e96af0442
commit
e95412a03c
2 changed files with 6 additions and 3 deletions
|
@ -18,8 +18,11 @@ export default {
|
|||
state () {
|
||||
return get(this.$parent, this.path)
|
||||
},
|
||||
defaultState () {
|
||||
return get(this.$parent, this.pathDefault)
|
||||
},
|
||||
isChanged () {
|
||||
return get(this.$parent, this.path) !== get(this.$parent, this.pathDefault)
|
||||
return this.state !== undefined && this.state !== this.defaultState
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -17,13 +17,13 @@ export default {
|
|||
return [firstSegment + 'DefaultValue', ...rest].join('.')
|
||||
},
|
||||
state () {
|
||||
return get(this.$parent, this.path)
|
||||
return get(this.$parent, this.path) || get(this.$parent, this.pathDefault)
|
||||
},
|
||||
defaultState () {
|
||||
return get(this.$parent, this.pathDefault)
|
||||
},
|
||||
isChanged () {
|
||||
return get(this.$parent, this.path) !== get(this.$parent, this.pathDefault)
|
||||
return this.state !== undefined && this.state !== this.defaultState
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
Loading…
Reference in a new issue