Basic usage
- <button class="btn btn-success" @click="showModal()">
- Open Modal
- </button>
- <VaModal v-model="isModalOpen" title="Basic Modal" message="Modal Content"/>
- import VaModal from '/vuestic-components/va-modal/VaModal'
- export default {
- name: 'modals',
- components: {
- VaModal
- },
- data () {
- return {
- isOpen: false
- }
- },
- methods: {
- showModal () {
- this.isOpen = true;
- }
- }
- // ...
- }
Props
value
- Boolean - controls visibility of modalposition
- String - usesize='top'
to set the position of modal. Use one of these values['top', 'right', 'bottom', 'left']
size
- String (default: 'medium') - use:size="small"
to set the size of modal. Use one of these values['small', 'medium', 'large']
closeButton
- Boolean (default: false) - usecloseButton
to show close icon on the top rightfullscreen
- Boolean (default false) - usefullscreen
to show modal in fullscreen modemobileFullscreen
- Boolean (default: true) - usemobile-fullscreen: false
to prevent fullscreeen mode on mobile devicesmaxWidth
- String - usemax-width
string. You can use any line as in ordinary css.300px, 30%
etc.maxHeight
- String (default90vh
) - usemax-height
to change the maximum height of the modal. If content is larger, scroll will appearnoEscDismiss
- Boolean (default: false) - useno-esc-dismiss: true
to disallow close modal on esc button clicknoOutsideDismiss
- Boolean (default false) - useno-outside-dismiss: true
to disallow close modal when outside modal was clickedhideDefaultActions
- Boolean (default: false) - usehideDefaultActions: true
to hide Cancel and Ok buttonsokText
- String (default: 'OK') - useokText="Some Text Here"
to set text in confirm buttoncancelText
- String (default: 'Cancel') - usecancelText="Some Text Here"
to set text in cancel buttonfixedLayout
- Boolean (default: false) - usefixedLayout: true
to scroll only content in modal. Title and actions will be fixedwithoutTransitions
- Boolean (default: false) - usewithoutTransitions: true
to turn off the animations on the modal
EventsonOk
- action, that happens if user clicks on "OK" buttononCancel
- action, that happens if user clicks on "Cancel" button or close icon
Slotsdefault
- the main content of the modalheader
- appears after the title in the modalactions
- appears after the default actions at the bottom of the modal
Find DEMOs here!