forked from AkkomaGang/admin-fe
Render editable keyword input for settings that have type ['list', 'tuple']
This commit is contained in:
parent
0323053fee
commit
3f82738d86
2 changed files with 7 additions and 2 deletions
|
@ -254,7 +254,8 @@ export default {
|
|||
}
|
||||
},
|
||||
keywordData() {
|
||||
if (this.settingParent.length > 0) {
|
||||
if (this.settingParent.length > 0 ||
|
||||
(Array.isArray(this.setting.type) && this.setting.type.includes('tuple') && this.setting.type.includes('list'))) {
|
||||
return Array.isArray(this.data[this.setting.key]) ? this.data[this.setting.key] : []
|
||||
}
|
||||
return Array.isArray(this.data) ? this.data : []
|
||||
|
@ -286,6 +287,7 @@ export default {
|
|||
return type === 'map' ||
|
||||
(Array.isArray(type) && type.includes('keyword') && type.includes('integer')) ||
|
||||
(Array.isArray(type) && type.includes('keyword') && type.includes('string')) ||
|
||||
(Array.isArray(type) && type.includes('tuple') && type.includes('list')) ||
|
||||
(Array.isArray(type) && type.includes('keyword') && type.findIndex(el => el.includes('list') && el.includes('string')) !== -1)
|
||||
},
|
||||
getFormattedDescription(desc) {
|
||||
|
|
|
@ -64,7 +64,10 @@ export default {
|
|||
return Array.isArray(this.setting.type) && this.setting.type.includes('keyword') && this.setting.type.includes('integer')
|
||||
},
|
||||
editableKeywordWithString() {
|
||||
return Array.isArray(this.setting.type) && this.setting.type.includes('keyword') && this.setting.type.includes('string')
|
||||
return Array.isArray(this.setting.type) && (
|
||||
(this.setting.type.includes('keyword') && this.setting.type.includes('string')) ||
|
||||
(this.setting.type.includes('tuple') && this.setting.type.includes('list'))
|
||||
)
|
||||
},
|
||||
isDesktop() {
|
||||
return this.$store.state.app.device === 'desktop'
|
||||
|
|
Loading…
Reference in a new issue