Permalink
Browse files

feat(carousel): Add img slot to carousel-slide (#879)

* feat(carousel-slide): Add slot for image

* Update README.md

* Update README.md
  • Loading branch information...
tmorehouse committed Aug 17, 2017
1 parent 5fc14d2 commit 9d789e7dcf3c47553e3676c81b282c08a5d4b8d5
Showing with 9 additions and 1 deletion.
  1. +6 −0 docs/components/carousel/README.md
  2. +3 −1 lib/components/carousel-slide.vue
@@ -32,6 +32,12 @@ controls and indicators.
<b-carousel-slide img="https://lorempixel.com/1024/480/technics/8/">
</b-carousel-slide>
<!-- Slides with img slot -->
<b-carousel-slide>
<img slot="img" class="d-block img-fluid"
src="https://lorempixel.com/1024/480/technics/5/" alt="image slot">
</b-carousel-slide>
<!-- Slide with blank image to maintain aspect ratio -->
<b-carousel-slide caption="Blank Image" :img="blankImg(1024,480)">
<p>
@@ -4,7 +4,9 @@
:id="id || null"
:style="{background,height}"
>
<img class="d-block img-fluid" v-if="img" :src="img" :alt="imgAlt">
<slot name="img">
<img class="d-block img-fluid" v-if="img" :src="img" :alt="imgAlt">
</slot>
<div :is="contentTag" :class="contentClasses">
<h3 v-if="caption" :is="captionTag" v-html="caption"></h3>
<p v-if="text" :is="textTag" v-html="text"></p>

0 comments on commit 9d789e7

Please sign in to comment.