Skip to content

Commit 41db896

Browse files
committed
feat: Add CCarosuel component.
1 parent 2057ba6 commit 41db896

File tree

1 file changed

+24
-75
lines changed

1 file changed

+24
-75
lines changed

src/views/base/Carousels.vue

Lines changed: 24 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,37 @@
1-
<template>
1+
<template functional>
22
<div class="wrapper">
33
<div class="animated fadeIn">
44
<CRow>
55
<CCol md="12" lg="9" >
66
<CCard>
77
<CCardHeader slot="header">
8-
<i class="fa fa-align-justify"></i><strong> Bootstrap Carousel</strong>
8+
<i class="fa fa-align-justify"></i>
9+
<strong> Bootstrap Carousel</strong>
910
<div class="card-header-actions">
10-
<a href="https://bootstrap-vue.js.org/docs/components/carousel" class="card-header-action" rel="noreferrer noopener" target="_blank">
11+
<a
12+
href="https://bootstrap-vue.js.org/docs/components/carousel"
13+
class="card-header-action"
14+
rel="noreferrer noopener"
15+
target="_blank"
16+
>
1117
<small class="text-muted">docs</small>
1218
</a>
1319
</div>
1420
</CCardHeader>
15-
<div>
16-
<CCarousel/>
17-
<br>
18-
<b-carousel id="carousel1"
19-
style="text-shadow: 1px 1px 2px #333;"
20-
controls
21-
indicators
22-
background="#ababab"
23-
:interval="400000"
24-
img-width="1024"
25-
img-height="480"
26-
v-model="slide"
27-
@sliding-start="onSlideStart"
28-
@sliding-end="onSlideEnd"
29-
>
30-
31-
<!-- Text slides with image -->
32-
<b-carousel-slide caption="First slide"
33-
text="Nulla vitae elit libero, a pharetra augue mollis interdum."
34-
img-src="https://lorempixel.com/1024/480/technics/2/"
35-
></b-carousel-slide>
36-
37-
<!-- Slides with custom text -->
38-
<b-carousel-slide img-src="https://lorempixel.com/1024/480/technics/4/">
39-
<h1>Hello world!</h1>
40-
</b-carousel-slide>
41-
42-
<!-- Slides with image only -->
43-
<b-carousel-slide img-src="https://lorempixel.com/1024/480/technics/8/">
44-
</b-carousel-slide>
45-
46-
<!-- Slides with img slot -->
47-
<!-- Note the classes .d-block and .img-fluid to prevent browser default image alignment -->
48-
<b-carousel-slide>
49-
<img slot="img" class="d-block img-fluid w-100" width="1024" height="480"
50-
src="https://lorempixel.com/1024/480/technics/5/" alt="image slot">
51-
</b-carousel-slide>
52-
53-
<!-- Slide with blank fluid image to maintain slide aspect ratio -->
54-
<b-carousel-slide caption="Blank Image" img-blank img-alt="Blank image">
55-
<p>
56-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
57-
eros felis, tincidunt a tincidunt eget, convallis vel est. Ut pellentesque
58-
ut lacus vel interdum.
59-
</p>
60-
</b-carousel-slide>
61-
62-
</b-carousel>
63-
64-
<p class="mt-4">
65-
Slide #: {{ slide }}<br>
66-
Sliding: {{ sliding }}
67-
</p>
68-
69-
</div>
21+
<CCarousel>
22+
<CCarouselItem
23+
caption="First Slide"
24+
imgSrc="https://lorempixel.com/1024/480/technics/2/"
25+
text="Nulla vitae elit libero, a pharetra augue mollis interdum."
26+
/>
27+
<CCarouselItem
28+
active
29+
imgSrc="https://lorempixel.com/1024/480/technics/4/"
30+
/>
31+
<CCarouselItem
32+
imgSrc="https://lorempixel.com/1024/480/technics/8/"
33+
/>
34+
</CCarousel>
7035
</CCard>
7136
</CCol>
7237
</CRow>
@@ -76,22 +41,6 @@
7641

7742
<script>
7843
export default {
79-
name: 'carousels',
80-
data () {
81-
return {
82-
slide: 0,
83-
sliding: null
84-
}
85-
},
86-
methods: {
87-
onSlideStart (slide) {
88-
console.log('onSlideStart', slide)
89-
this.sliding = true
90-
},
91-
onSlideEnd (slide) {
92-
console.log('onSlideEnd', slide)
93-
this.sliding = false
94-
}
95-
}
44+
name: 'carousels'
9645
}
9746
</script>

0 commit comments

Comments
 (0)