2.0.6 • Published 10 months ago

@appoly/vue-modal v2.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Vue Modal

Installation

Install Vue Modal with npm

npm install @appoly/vue-modal

Props

PropTypeDefaultDescription
confirmButtonTextstringConfirmText displayed on the confirm button
confirmButtonClassstringCustom class for the confirm button
closeOnOutsideClickbooltrueClose the modal by clicking on the outside
showConfirmButtonstringtrueDisplay the confirm button
cancelButtonTextstringCancelText displayed on the cancel button
cancelButtonClassstringCustom class for the cancel button
closeOnButtonClickbooltrueModal can be closed on cancel/confirm click or an event is emitted and can be closed via functions
escClosesModalbooltrueShould the modal close if the Esc key is pressed (and closeOnOutsideClick is True)
animationstringzoomAnimation type, options include zoom, bounce, fade & none
timeoutnumber0Should the modal automatically close, time set in milliseconds
widthstring700pxWidth of the modal in px, rem, em, %. Just numbers default to px
maxHeightstring75%Height of the modal in px, rem, em, %. Just number default to px
sticky-headerboolfalseShould the modal have a sticky header
sticky-footerboolfalseShould the modal have a sticky footer

Slots

SlotDescription
headerContent for the top of the modal
bodyContent for the center of the modal
footerContent for the bottom of the modal (above the buttons)
buttonsReplaces the buttons

Usage/Examples

import VueModal from '@appoly/vue-modal';
<VueModal ref="myModal" timeout="5000">
    <template #header>
        <h1>My Modal</h1>
        <hr>
    </template>
    <template #body>
        <p>This modal will hide in 5 seconds</p>
    </template>
</VueModal>

Open Modal

this.$refs.myModal.openModal();

Close Modal

If closeOnButtonClick is turned off you will need to listen for the confirm and cancel events and close the modal using

this.$refs.myModal.closeModal();
3.0.1

10 months ago

2.0.6

10 months ago

3.0.0

1 year ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago