Browse Source

fix: render label span only if default slot is defined

pull/7106/head
Pranav C 1 year ago
parent
commit
cf54deedbf
  1. 2
      packages/nc-gui/components/nc/Switch.vue

2
packages/nc-gui/components/nc/Switch.vue

@ -12,7 +12,7 @@ const onChange = (e: boolean) => {
<template>
<a-switch v-model:checked="checked" :disabled="props.disabled" class="nc-switch" size="small" @change="onChange"> </a-switch>
<span class="cursor-pointer pl-2" @click="checked = !checked">
<span v-if="$slots.default" class="cursor-pointer pl-2" @click="checked = !checked">
<slot />
</span>
</template>

Loading…
Cancel
Save