forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathControls.vue
More file actions
54 lines (51 loc) · 1.5 KB
/
Controls.vue
File metadata and controls
54 lines (51 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<template>
<div class="q-pa-md">
<q-carousel
swipeable
animated
v-model="slide"
:autoplay="autoplay"
ref="carousel"
infinite
>
<q-carousel-slide :name="1" img-src="https://cdn.quasar.dev/img/mountains.jpg" />
<q-carousel-slide :name="2" img-src="https://cdn.quasar.dev/img/parallax1.jpg" />
<q-carousel-slide :name="3" img-src="https://cdn.quasar.dev/img/parallax2.jpg" />
<q-carousel-slide :name="4" img-src="https://cdn.quasar.dev/img/quasar.jpg" />
<template v-slot:control>
<q-carousel-control
position="top-right"
:offset="[18, 18]"
class="text-white"
style="background: rgba(0, 0, 0, .3); padding: 4px 8px 4px 0; border-radius: 4px"
>
<q-toggle dense dark color="orange" v-model="autoplay" label="Auto Play" />
</q-carousel-control>
<q-carousel-control
position="bottom-right"
:offset="[18, 18]"
class="q-gutter-xs"
>
<q-btn
push round dense color="orange" text-color="black" icon="arrow_left"
@click="$refs.carousel.previous()"
/>
<q-btn
push round dense color="orange" text-color="black" icon="arrow_right"
@click="$refs.carousel.next()"
/>
</q-carousel-control>
</template>
</q-carousel>
</div>
</template>
<script>
export default {
data () {
return {
slide: 1,
autoplay: false
}
}
}
</script>