From 1b14a1ed301ce899b6a7c9d4141ef3390eebbc03 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Wed, 4 Mar 2020 09:39:18 +0300 Subject: [PATCH] Fixed #221 - Primitive values support in Select components --- src/components/dropdown/Dropdown.vue | 2 +- src/components/listbox/Listbox.vue | 2 +- src/components/selectbutton/SelectButton.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/dropdown/Dropdown.vue b/src/components/dropdown/Dropdown.vue index 62978ea09..f5992f609 100644 --- a/src/components/dropdown/Dropdown.vue +++ b/src/components/dropdown/Dropdown.vue @@ -84,7 +84,7 @@ export default { }, methods: { getOptionLabel(option) { - return ObjectUtils.resolveFieldData(option, this.optionLabel); + return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option; }, getOptionValue(option) { return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : option; diff --git a/src/components/listbox/Listbox.vue b/src/components/listbox/Listbox.vue index 37449144e..ecdcfa0c7 100644 --- a/src/components/listbox/Listbox.vue +++ b/src/components/listbox/Listbox.vue @@ -45,7 +45,7 @@ export default { }, methods: { getOptionLabel(option) { - return ObjectUtils.resolveFieldData(option, this.optionLabel); + return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option; }, getOptionValue(option) { return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : option; diff --git a/src/components/selectbutton/SelectButton.vue b/src/components/selectbutton/SelectButton.vue index 196ebfcef..8ce391a55 100644 --- a/src/components/selectbutton/SelectButton.vue +++ b/src/components/selectbutton/SelectButton.vue @@ -33,7 +33,7 @@ export default { }, methods: { getOptionLabel(option) { - return ObjectUtils.resolveFieldData(option, this.optionLabel); + return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option; }, getOptionValue(option) { return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : option;