xxxxxxxxxx
1
<template>
2
<a class="me-3 text-dark" @click="launchModal" href="#">Launch Modal</a>
3
<MDBModal
4
id="exampleModal"
5
tabindex="-1"
6
labelledby="exampleModalLabel"
7
v-model="exampleModal"
8
>
9
<MDBModalHeader>
10
<MDBModalTitle id="exampleModalLabel"> Modal title </MDBModalTitle>
11
</MDBModalHeader>
12
<MDBModalBody>...</MDBModalBody>
13
<MDBModalFooter>
14
<MDBBtn color="secondary" @click="exampleModal = false">Close</MDBBtn>
15
<MDBBtn color="primary">Save changes</MDBBtn>
16
</MDBModalFooter>
17
</MDBModal>
18
</template>
xxxxxxxxxx
1
<style>
2
#app {
3
font-family: Roboto, Helvetica, Arial, sans-serif;
4
}
5
</style>
xxxxxxxxxx
1
<script>
2
import {
3
MDBModal,
4
MDBModalHeader,
5
MDBModalTitle,
6
MDBModalBody,
7
MDBModalFooter,
8
MDBBtn,
9
} from 'mdb-vue-ui-kit';
10
import { ref } from 'vue';
11
export default {
12
components: {
13
MDBModal,
14
MDBModalHeader,
15
MDBModalTitle,
16
MDBModalBody,
17
MDBModalFooter,
18
MDBBtn,
19
},
20
setup() {
21
const exampleModal = ref(false);
22
23
const launchModal = () => {
24
exampleModal.value = true
25
}
26
return {
27
exampleModal,
28
launchModal
29
};
30
},
31
};
32
</script>
Console errors: 0