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
64 lines (54 loc) · 1.12 KB
/
Basic.vue
File metadata and controls
64 lines (54 loc) · 1.12 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
<template>
<div class="relative-position">
<div class="example-area q-pa-lg scroll">
<div class="example-filler" />
<div v-intersection="onIntersection" class="example-observed text-center rounded-borders">
Observed Element
</div>
<div class="example-filler" />
</div>
<div
class="example-state rounded-borders text-center absolute-top q-mt-md q-ml-md q-mr-lg text-white"
:class="visibleClass"
>
{{ visible === true ? 'Visible' : 'Hidden' }}
</div>
</div>
</template>
<script>
export default {
data () {
return {
visible: false
}
},
computed: {
visibleClass () {
return `bg-${this.visible ? 'positive' : 'negative'}`
}
},
methods: {
onIntersection (entry) {
this.visible = entry.isIntersecting
}
}
}
</script>
<style lang="sass" scoped>
.example-state
background: #ccc
font-size: 20px
color: #282a37
padding: 10px
opacity: 0.8
.example-observed
width: 100%
font-size: 20px
color: #ccc
background: #282a37
padding: 10px
.example-area
height: 300px
.example-filler
height: 500px
</style>