Fixed #4944 - CascadeSelect: optionGroupChildren doesn't work in string type

pull/4954/head
tugcekucukoglu 2023-12-08 12:30:23 +03:00
parent ffb786f1b1
commit 573e4a0091
2 changed files with 5 additions and 2 deletions

View File

@ -147,7 +147,7 @@ export default {
return this.optionGroupLabel ? ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel) : null;
},
getOptionGroupChildren(optionGroup, level) {
return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[level]);
return ObjectUtils.isString(this.optionGroupChildren) ? ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren) : ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[level]);
},
isOptionGroup(option, level) {
return Object.prototype.hasOwnProperty.call(option, this.optionGroupChildren[level]);

View File

@ -73,7 +73,10 @@ export default {
optionDisabled: null,
optionGroupIcon: String,
optionGroupLabel: String,
optionGroupChildren: Array,
optionGroupChildren: {
type: [String, Array],
default: null
},
activeOptionPath: Array,
level: Number,
templates: null,