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; return this.optionGroupLabel ? ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel) : null;
}, },
getOptionGroupChildren(optionGroup, level) { 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) { isOptionGroup(option, level) {
return Object.prototype.hasOwnProperty.call(option, this.optionGroupChildren[level]); return Object.prototype.hasOwnProperty.call(option, this.optionGroupChildren[level]);

View File

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