fixes for diabled state, tri-state boolean and access control
This commit is contained in:
parent
2bf224e214
commit
6992439c92
7 changed files with 115 additions and 8 deletions
|
|
@ -3,13 +3,28 @@ import Setting from './setting.js'
|
|||
|
||||
export default {
|
||||
...Setting,
|
||||
props: {
|
||||
...Setting.props,
|
||||
indeterminateState: [String, Object]
|
||||
},
|
||||
components: {
|
||||
...Setting.components,
|
||||
Checkbox
|
||||
},
|
||||
computed: {
|
||||
...Setting.computed,
|
||||
isIndeterminate () {
|
||||
return this.visibleState === this.indeterminateState
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...Setting.methods,
|
||||
getValue (e) {
|
||||
// Basic tri-state toggle implementation
|
||||
if (!!this.indeterminateState && !e && this.visibleState === true) {
|
||||
// If we have indeterminate state, switching from true to false first goes through indeterminate
|
||||
return this.indeterminateState
|
||||
}
|
||||
return e
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue