0.1.3 • Published 6 years ago

vue-notify-plugin v0.1.3

Weekly downloads
18
License
-
Repository
github
Last release
6 years ago

Vue-notify-plugin 💬

Vue plugin for non-blocking notifications.

Installation

npm install vue-notify-plugin

or

yarn add vue-notify-plugin

Configuration

import Vue from 'vue';
import VueNotifyPlugin from 'vue-notify-plugin';

Vue.use(VueNotifyPlugin, {
    position: 'top-left'
});

Initialization params:

All options are optional.

NameTypeDefaultDesciption
positionString'top-right'The location of the notifications, currently possible: top-right, top-left, bottom-right, bottom-left
maxNotifsCountNumber3Maximum number of notifications that can be shown in notification holder
customTemplateObject-Expect vue component that will be used as a tempalte of notification content. Will get following props: message, icon, data, description, customOptions

Usage

In any of your vue-components, simply call this methods:

this.$notify.push("Hello world!", [options])

Each notification expects message as first required argument.

Notification options:

All props are optional.

NameTypeDefaultDesciption
durationNumber5000The amount of milliseconds that the animation should take
showExpirationBooleantrueDispaly expiration progress bar
closeByUserBooleanfalseMake user to close notification by himself
closeOnClickBooleanfalseClose notification on click
descriptionString-More detail notification description
dateString-Date
iconString-Url of icon
customOptionsObject-Additional params for custom template
onClickFunction-Cotification click handler, except click on close button
onCloseFunction-Close button click handler

Development

Project setup

yarn install

Compiles and hot-reloads for development

yarn run serve