HTML
xxxxxxxxxx
1
<template>
2
<section>
3
<MDBBtn
4
@click="cookiesShowMore = !cookiesShowMore"
5
outline="primary"
6
>Show</MDBBtn
7
>
8
<MDBCollapse v-model="cookiesShowMore">
9
<div
10
id="collapsed-content"
11
style="
12
overflow-y: auto;
13
height: 100px;
14
width: 100%;
15
text-align: center;
16
"
17
>
18
<a
19
href="#scrollTo"
20
v-mdb-smooth-scroll="{ container: '#collapsed-content' }"
21
>
22
USE Smooth scroll
23
</a>
24
<div
25
style="height: 100px; text-align: center"
26
id="scrollTo"
27
class="d-flex flex-column align-items-center mt-5"
28
>
29
<MDBSwitch v-model="switchAnalytic" />
30
<p>switch value:</p>
31
<p>{{ switchAnalytic }}</p>
32
</div>
33
</div>
34
</MDBCollapse>
35
</section>
36
</template>
SCSS
xxxxxxxxxx
1
<style>
2
#app {
3
font-family: Roboto, Helvetica, Arial, sans-serif;
4
}
5
</style>
JS
xxxxxxxxxx
1
<script>
2
import { MDBBtn, MDBCollapse, MDBSwitch, mdbSmoothScroll } from "mdb-vue-ui-kit";
3
import { ref, toRefs } from "vue"
4
5
6
export default {
7
name: "App",
8
components: {
9
MDBBtn, MDBCollapse, MDBSwitch
10
},
11
directives: {
12
mdbSmoothScroll
13
},
14
setup() {
15
const cookiesShowMore = ref(false)
16
const switchAnalytic = ref(true)
17
18
return {
19
cookiesShowMore,
20
switchAnalytic
21
}
22
}
23
};
24
</script>
Console errors: 0