refactor: remove unnecessary check for slot contents

This commit is contained in:
jamesgeorge007
2023-12-12 11:55:05 +05:30
committed by Andrew Bastin
parent 40b9508361
commit 019c2cec46

View File

@@ -8,9 +8,7 @@
:class="large ? 'w-32 h-32' : 'w-16 h-16'" :class="large ? 'w-32 h-32' : 'w-16 h-16'"
:alt="alt" :alt="alt"
/> />
<template v-if="hasIcon"> <slot name="icon"></slot>
<slot name="icon"></slot>
</template>
<span v-if="heading" class="font-semibold mt-2 text-center"> <span v-if="heading" class="font-semibold mt-2 text-center">
{{ heading }} {{ heading }}
</span> </span>
@@ -45,10 +43,6 @@ withDefaults(
const slots = useSlots() const slots = useSlots()
const hasIcon = computed(() => {
return !!slots.icon
})
const hasBody = computed(() => { const hasBody = computed(() => {
return !!slots.body return !!slots.body
}) })