1.0.0 • Published 4 years ago

popup-widget-q v1.0.0

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

PopupWidgetQ

Vue.js popup widget

Getting started

Installation

  1. Install:
npm install popup-widget-q
  1. Add to project globally (main.js):
import PopupWidget from 'popup-widget-q'

Vue.use(PopupWidget)

Add locally to the component:

import { PopupWidget } from 'popup-widget-q'

export default {
  components: {
    PopupWidget
  }
}

Use Widget

<template>
  <popup-widget
    :iconPath="widgetIconPath"
    :defaultMode='`expanded`'
    :autoexpand='false'
    :autoexpandMs='2000'
    :closeByEsc='true'
    :widgetColor="`#FFB500`"
    :position="{
        bottom: position.bottom,
        right: position.right,
    }"
    :stopAutoexpand="!autoexpandNewsletterModal"
    @onMinimized="onMinimized"
    :showDelayMs='8000' >

  </popup-widget>
</template>

Available Props

PropTypeDefaultDescription
defaultModeStringnulldefault mode to pop up. Can be 'minimized' or 'expanded'
textStringnulltext content for expanded modal if no slot provided
titleStringnulltitle for expanded modal if no slot provided
iconPathStringnullurl for mimnimized widget icon
iconTextString'🎁'text showing on minimized widget if no icon path provided
autoexpandBooleanfalsetrue/false autoexpand after autoexpandMs
autoexpandMsNumber7000ms to autoexpand
closeByEscBooleantrueminimize or not widget by Esc button
widgetColorString'#9ec939'color for minimized widget backgroud color
fontColorStringnullcolor for icon (if iconText provided). Autoselect (black/white if null)
showDelayMsNumber0ms delay to show
positionObject{bottom: '30px', right: '30px'}css top, bottom, right or left attributes for fixed position
stopAutoexpandBooleanfalseyou can pass this prop to stop autoexpand

Available Hooks

onMinimized - called after widget is minimized

1.0.0

4 years ago