Skip to content

Commit 8627dc7

Browse files
committed
feat(docs): Add QCarousel fullscreen example
1 parent 5552c7e commit 8627dc7

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<template>
2+
<div class="q-pa-md">
3+
<q-carousel
4+
swipeable
5+
animated
6+
arrows
7+
v-model="slide"
8+
:fullscreen.sync="fullscreen"
9+
infinite
10+
>
11+
<q-carousel-slide :name="1" img-src="https://cdn.quasar-framework.org/img/mountains.jpg" />
12+
<q-carousel-slide :name="2" img-src="https://cdn.quasar-framework.org/img/parallax1.jpg" />
13+
<q-carousel-slide :name="3" img-src="https://cdn.quasar-framework.org/img/parallax2.jpg" />
14+
<q-carousel-slide :name="4" img-src="https://cdn.quasar-framework.org/img/quasar.jpg" />
15+
16+
<template v-slot:control>
17+
<q-carousel-control
18+
position="bottom-right"
19+
:offset="[18, 18]"
20+
>
21+
<q-btn
22+
push round dense color="white" text-color="primary"
23+
:icon="fullscreen ? 'fullscreen_exit' : 'fullscreen'"
24+
@click="fullscreen = !fullscreen"
25+
/>
26+
</q-carousel-control>
27+
</template>
28+
</q-carousel>
29+
</div>
30+
</template>
31+
32+
<script>
33+
export default {
34+
data () {
35+
return {
36+
slide: 1,
37+
fullscreen: false
38+
}
39+
}
40+
}
41+
</script>

docs/src/pages/vue-components/carousel.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ Don't use the property `navigation` with `thumbnails` as it supercedes and thumb
4343
### Controls
4444
<doc-example title="Controls" file="QCarousel/Controls" />
4545

46+
### Fullscreen
47+
<doc-example title="Fullscreen" file="QCarousel/Fullscreen" />
48+
4649
## QCarousel API
4750
<doc-api file="QCarousel" />
4851

quasar/dev/components/components/carousel.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,25 @@
161161
arrows
162162
thumbnails
163163
infinite
164+
:fullscreen.sync="full"
164165
>
165166
<q-carousel-slide :name="0" img-src="https://cdn.quasar-framework.org/img/mountains.jpg" />
166167
<q-carousel-slide :name="1" img-src="https://cdn.quasar-framework.org/img/parallax1.jpg" />
167168
<q-carousel-slide :name="2" img-src="https://cdn.quasar-framework.org/img/parallax2.jpg" />
168169
<q-carousel-slide :name="3" img-src="https://cdn.quasar-framework.org/img/quasar.jpg" />
170+
171+
<template v-slot:control>
172+
<q-carousel-control
173+
position="top-right"
174+
:offset="[38, 38]"
175+
>
176+
<q-btn
177+
push round dense color="white" text-color="primary"
178+
:icon="full ? 'fullscreen_exit' : 'fullscreen'"
179+
@click="full = !full"
180+
/>
181+
</q-carousel-control>
182+
</template>
169183
</q-carousel>
170184

171185
<p class="caption">
@@ -203,6 +217,7 @@
203217
export default {
204218
data: () => ({
205219
fullscreen: false,
220+
full: false,
206221
slide: 0,
207222
slide2: 1,
208223
slide3: 1,

quasar/src/components/carousel/carousel.styl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.q-carousel
2+
background-color inherit // needed for fullscreen
23
height 400px
34

45
&__slide

0 commit comments

Comments
 (0)