From 7fa5106cbd30824fca3593ad31375de336c7b527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Thu, 11 Jan 2024 22:54:49 +0100 Subject: [PATCH] fix(NcCheckboxContent): correctly check default slot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- .../NcCheckboxRadioSwitch/NcCheckboxContent.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/NcCheckboxRadioSwitch/NcCheckboxContent.vue b/src/components/NcCheckboxRadioSwitch/NcCheckboxContent.vue index 784f1744ec..4704a22fe1 100644 --- a/src/components/NcCheckboxRadioSwitch/NcCheckboxContent.vue +++ b/src/components/NcCheckboxRadioSwitch/NcCheckboxContent.vue @@ -26,7 +26,7 @@ :class="{ ['checkbox-content-' + type]: true, 'checkbox-content--button-variant': buttonVariant, - 'checkbox-content--has-text': !!$slots.default, + 'checkbox-content--has-text': isSlotPopulated($slots.default()), }"> @@ -70,6 +70,7 @@ import ToggleSwitchOff from 'vue-material-design-icons/ToggleSwitchOff.vue' import ToggleSwitch from 'vue-material-design-icons/ToggleSwitch.vue' import NcLoadingIcon from '../NcLoadingIcon/index.js' +import isSlotPopulated from '../../utils/isSlotPopulated.ts' export const TYPE_CHECKBOX = 'checkbox' export const TYPE_RADIO = 'radio' @@ -166,6 +167,10 @@ export default { }, }, + methods: { + isSlotPopulated, + }, + computed: { isButtonType() { return this.type === TYPE_BUTTON