You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I feel like there is a simple answer here that I'm missing.
<b-button size="sm" @click="toggle">
<template>
{{ show ? 'Hide' : 'Show' }} Alert one
</template>
</b-button>
works fine and renders the button content
<b-button size="sm" @click="toggle">
<template #default>
{{ show ? 'Hide' : 'Show' }} Alert one
</template>
</b-button>
doesn't render the button content. In reading the spec for the button, it does reference a default slot and I expect that the test passes, but it doesn't seem to work?
Why do I need this?
I would like to be able to render a dropdown button in some cases and a button in other cases with something like:
<component :is="someCondition ? 'b-dropdown' : 'b-button'>
<template #[conditionalSlotName]>
The button content which is in slot #button-content when the component is a dropdown and in #default when the component is a button.
</template>
</component>
I did look for similar discussions but might have missed something. If so, my apologies and thanks for pointing that out.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I feel like there is a simple answer here that I'm missing.
works fine and renders the button content
doesn't render the button content. In reading the spec for the button, it does reference a default slot and I expect that the test passes, but it doesn't seem to work?
Why do I need this?
I would like to be able to render a dropdown button in some cases and a button in other cases with something like:
Beta Was this translation helpful? Give feedback.
All reactions