1.2.1 • Published 5 years ago

vue-com-popup v1.2.1

Weekly downloads
14
License
-
Repository
-
Last release
5 years ago

Overview

vue-com-popup is a popup component for vue.js and yet nuxt.js

Installation

$ npm i vue-com-popup

Props

NameDescriptionValueDefault
nameFor using with event bus (Vue.prototype.$bus)String''
triggerOpen/Close popupBooleanfalse
closeByClickOnContentClose popup after click insideBooleanfalse
closeByClickOnOverlayClose popup after click outsideBooleanfalse
closeOnEventListen event from content (Use this.$parent.$emit in child)String'close'
hideCloseIconThank you, Captain!Booleanfalse
smallDeviceWidthFull screen mode for devices smaller thisNumber768
inlineStylePopup CSSObjectnull
onOpenCallback for open eventFunctionnull
onCloseCallback for close eventFunctionnull

Example

Using vue-com-popup inside another vue component:

<template>
    <div>
        <button @click="popupState =! popupState">Popup trigger</button>
        <com-popup
            :trigger="popupState"
            :inline-style="{
                'min-width': '30%',
                'padding': '20px'
            }">
            <h1>Popup tittle</h1>
            <p>Popup content</p>
        </com-popup>
    </div>
</template>


<script>
import ComPopup from 'vue-com-popup';

export default {
    components: {
        ComPopup,
    },

    data() {
        return {
            popupState: false
        };
    },

};
</script>