forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasic.vue
More file actions
78 lines (68 loc) · 1.56 KB
/
Basic.vue
File metadata and controls
78 lines (68 loc) · 1.56 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<template>
<div class="q-pa-md row justify-center">
<q-card
v-touch-pan.prevent.mouse="handlePan"
class="custom-area cursor-pointer bg-primary text-white shadow-2 relative-position row flex-center"
>
<div v-if="info" class="custom-info">
<pre>{{ info }}</pre>
</div>
<div v-else class="text-center">
<q-icon name="arrow_upward" />
<div class="row items-center">
<q-icon name="arrow_back" />
<div>Pan in any direction</div>
<q-icon name="arrow_forward" />
</div>
<q-icon name="arrow_downward" />
</div>
<div v-show="panning" class="touch-signal">
<q-icon name="touch_app" />
</div>
</q-card>
</div>
</template>
<script>
import { ref } from 'vue'
export default {
setup () {
const info = ref(null)
const panning = ref(false)
return {
info,
panning,
handlePan ({ evt, ...newInfo }) {
info.value = newInfo
// native Javascript event
// console.log(evt)
if (newInfo.isFirst) {
panning.value = true
}
else if (newInfo.isFinal) {
panning.value = false
}
}
}
}
}
</script>
<style lang="sass" scoped>
.custom-area
width: 90%
height: 480px
border-radius: 3px
padding: 8px
.custom-info pre
width: 180px
font-size: 12px
.touch-signal
position: absolute
top: 16px
right: 16px
width: 35px
height: 35px
font-size: 25px
border-radius: 50% !important
text-align: center
background: rgba(255, 255, 255, .2)
</style>