lost file
This commit is contained in:
parent
0c77a3e1d6
commit
1afda1ac6d
1 changed files with 30 additions and 0 deletions
30
src/components/settings_modal/helpers/boolean_setting.js
Normal file
30
src/components/settings_modal/helpers/boolean_setting.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { get, set } from 'lodash'
|
||||
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
||||
import ModifiedIndicator from './modified_indicator.vue'
|
||||
export default {
|
||||
components: {
|
||||
Checkbox,
|
||||
ModifiedIndicator
|
||||
},
|
||||
props: [
|
||||
'path',
|
||||
'disabled'
|
||||
],
|
||||
computed: {
|
||||
pathDefault () {
|
||||
const [firstSegment, ...rest] = this.path.split('.')
|
||||
return [firstSegment + 'DefaultValue', ...rest].join('.')
|
||||
},
|
||||
state () {
|
||||
return get(this.$parent, this.path)
|
||||
},
|
||||
isChanged () {
|
||||
return get(this.$parent, this.path) !== get(this.$parent, this.pathDefault)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
update (e) {
|
||||
set(this.$parent, this.path, e)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue