Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

b-button default slot#7140

Unanswered
jjimenez asked this question inQ&A
Mar 30, 2023· 0 comments
Discussion options

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.
You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@jjimenez

[8]ページ先頭

©2009-2025 Movatter.jp