@helios-interactive/vue-modal-termsandconditions
v1.0.1
Published
A simple terms and conditions modal for Vue
Downloads
1
Keywords
Readme
Vue Modal - Terms and Conditions
Super simple and easy to use.
How to use
npm install @helios-interactive/vue-modal-termsandconditions --save
Add the plugin to the main.js
file.
import Vue from 'vue';
import ModalTandc from '@helios-interactive/vue-modal-termsandconditions';
Vue.use(ModalTandc);
Now add the modal to your template.
<a @click="openModal">Terms and Conditions</a>
<modal-tandc
v-show="modal"
@hide="closeModal">
<template v-slot:header>
<h1>Terms and Conditions</h1>
</template>
<template v-slot:body>
<!-- Add in the body text here -->
</template>
<template v-slot:footer-btn>
Button Text
</template>
</modal-tandc>
Then add the open and close modal functions to the script.
import ModalTandc from '@helios-interactive/vue-modal-termsandconditions/src/plugins/ModalTandc'
components: { ModalTandc },
data() {
return {
modal: false
}
},
methods: {
openModal() {
this.modal = true;
},
closeModal() {
this.modal = false;
}
}
CSS
Current styles:
.modal {
background-color: rgba(0, 0, 0, 0.452);
height: 100%;
position: fixed;
left: 0;
top: 0;
width: 100%;
z-index: 999;
}
.inner-modal {
background-color: #ffffff;
border: 3px solid lightslategray;
border-radius: 3px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.445);
font-family: 'Tahoma', sans-serif;
height: 68%;
margin: 5% auto;
padding: 20px 30px;
width: 68%;
}
.header {
text-align: left;
}
.body-text {
max-height: 67%;
overflow-y: scroll;
text-align: left;
}
::-webkit-scrollbar {
display: none;
}
.modal-button {
background-color: lightslategray;
border-radius: 5%;
color: #ffffff;
font-size: 16px;
font-weight: 600;
margin-top: 25px;
outline: none;
padding: 10px 15px;
}
.modal-button:active {
background-color: #ffffff;
border: 2px solid lightslategray;
color: lightslategray;
}