question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<b-card> add class only for header or footer

See original GitHub issue

I have add class bg-info only for header or footer. I need create this block

<div class="card">
    <div class="card-header bg-info text-white">text</div>
     hello world
</div>

I tired

<b-card show-header>
   <div class="bg-info" slot="header" variant="info">test</div>
   hello world
 </b-card>

But this code transform in

<div class="card">
     <div class="card-header">
          <div class="bg-info text-white">text</div> 
    </div>
    hello world
</div>

How to do it?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
alexsasharegancommented, May 28, 2017

@losblancos113, I think you might want to consider making the headerClass prop accept a string or an array. Then you won’t need to set every object value to true or deal with any value sanitation (the regex replace and trim shouldn’t be necessary).

Also, I think we should extend this to the footer. Maybe you can even leave the class="card-header", but just add the plain :class="headerClass" since Vue can handle interpolating all the string, object, or array values to classes.

1reaction
tmorehousecommented, May 28, 2017

This features should be available in the next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cards - Bootstrap
A card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background...
Read more >
Vertically centered card between header and footer [closed]
3 Answers 3 ; To fix that error just add the styling z-index: 1 to the nav and z-index: -1 to the card...
Read more >
Card | Components - BootstrapVue
A card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background...
Read more >
card-footer - Bootstrap CSS class
Bootstrap CSS class card-footer with source code and live preview. You can copy our examples and paste them into your project!
Read more >
Bootstrap 4 card with outline headers and footers - johna's blog
If you use Bootstrap 4 cards and apply one of the outline classes to add some colour you will find the header and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found