forked from AkkomaGang/admin-fe
Disable tabs that don't have settings that can be changed
This commit is contained in:
parent
9c28eddec1
commit
88f2859f47
1 changed files with 6 additions and 1 deletions
|
@ -33,7 +33,7 @@
|
|||
<el-tab-pane
|
||||
v-for="(value, componentName) in tabs"
|
||||
:label="$t(value.label)"
|
||||
:disabled="configDisabled"
|
||||
:disabled="configDisabled || settingsCantBeChanged(value.settings)"
|
||||
:key="componentName"
|
||||
:name="componentName"
|
||||
lazy>
|
||||
|
@ -227,6 +227,11 @@ export default {
|
|||
: { value: `${searchObj.label} in ${searchObj.groupLabel}`, group: searchObj.groupKey, key: searchObj.key }
|
||||
})
|
||||
cb(results)
|
||||
},
|
||||
settingsCantBeChanged(settings) {
|
||||
const existingSettings = settings.filter(setting =>
|
||||
this.$store.state.settings.description.findIndex(el => el.key === setting) !== -1)
|
||||
return existingSettings.length === 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue