From 573e4a0091b3c5c46fe1cdb051d4932a43db525c Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Fri, 8 Dec 2023 12:30:23 +0300 Subject: [PATCH] Fixed #4944 - CascadeSelect: optionGroupChildren doesn't work in string type --- components/lib/cascadeselect/CascadeSelect.vue | 2 +- components/lib/cascadeselect/CascadeSelectSub.vue | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/lib/cascadeselect/CascadeSelect.vue b/components/lib/cascadeselect/CascadeSelect.vue index 865eb139e..177ab275a 100644 --- a/components/lib/cascadeselect/CascadeSelect.vue +++ b/components/lib/cascadeselect/CascadeSelect.vue @@ -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]); diff --git a/components/lib/cascadeselect/CascadeSelectSub.vue b/components/lib/cascadeselect/CascadeSelectSub.vue index 73585619b..484daf2fd 100644 --- a/components/lib/cascadeselect/CascadeSelectSub.vue +++ b/components/lib/cascadeselect/CascadeSelectSub.vue @@ -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,