79177150

Date: 2024-11-11 09:54:27
Score: 1
Natty:
Report link

simply use useSlots and apply css conditionally

const slots = useSlots()

const doesLeadingSlotExist = computed(() => {
    if ('leading' in slots) {
        return true;
    }
    return false;
});

Would have preferred a pure css solution but this approach also works.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: luQ