Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-evaluate slots and their roles #1777

Open
VividLemon opened this issue Feb 16, 2024 · 1 comment
Open

Re-evaluate slots and their roles #1777

VividLemon opened this issue Feb 16, 2024 · 1 comment
Labels
stale There has been no additional replies or questions and the thread is assumed closed

Comments

@VividLemon
Copy link
Member

Review the following example from BCard.vue

<BCardFooter
      v-if="footer || hasFooterSlot || footerHtml"
      v-bind="footerAttrs"
      :class="footerClass"
    >
      <slot name="footer">
        {{ footer }}
      </slot>
    </BCardFooter>

In this situation, you have the prop 'footer' & slot 'footer' do the exact same thing.

In this exact situation, you are able to modify BCardFooter with props, but this leaves some things to be desired.

Perhaps it would be better to refactor it as

<slot name="footer">
<BCardFooter
      v-if="footer || hasFooterSlot || footerHtml"
      v-bind="footerAttrs"
      :class="footerClass"
    >
        {{ footer }}
    </BCardFooter>
</slot>

This provides the most flexibility for modifying values. While also preserving an easy way to modify only the text. Should this be implemented? Idk. It would be a deviation from the Bootstrap-vue standard. Some research into how we use slots, what is more common, and how bootstrap-vue uses slots, and what is most common. Then set one standard and go with it.

Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity. It will not be auto-closed

@github-actions github-actions bot added the stale There has been no additional replies or questions and the thread is assumed closed label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale There has been no additional replies or questions and the thread is assumed closed
Projects
Status: Todo
Development

No branches or pull requests

1 participant