1.1.1 • Published 3 years ago

vuejs-snackbar-queue v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

vuejs-snackbar-queue

A Vuejs snackbar plugin that support multiple snackbars at one time

Installation

npm install vuejs-snackbar-queue

Basic Usage

import Vue from 'vue'
import SnackbarQueue from 'vuejs-snackbar-queue' 

Vue.use(SnackbarQueue)

Advanced Usage

Global options can be set when initialize the plugin

import Vue from 'vue'
import SnackbarQueue from 'vuejs-snackbar-queue' 

Vue.use(SnackbarQueue, { maxSnacks: 5, mobileBreakpoint: 600 })

Apply

Add the global component to your root component (App.vue)

<snackbar-queue/>

Open a snackbar from your .vue files

this.$snackbar.show({
    message: "Message",
    color: "green",
    timeout: 5000
});

Also you can open a snackbar from other files

import Vue from "vue";

const vue = new Vue();

vue.$snackbar.show({
    message: "Message",
    color: "green",
    timeout: 5000
});

Close all the snackbars by calling hideAll() method

this.$snackbar.hideAll();

Global Options

NameTypeDefaultDescription
maxSnacksNumber3Maximum number of snackbars that can be added to the queue
mobileBreakpointNumber600Snackbar is centered horizontally on screens those width below than mobileBreakpoint

API

NameTypeDefaultDescription
messageStringnullSnackbar message
colorString#333333Color of the snackbar
timeoutNumber4000Duration of the snackbar in ms. Use 0 to keep open indefinitely
horizontalStringcenterHorizontal position. Valid values : center, left, right
verticalStringtopVertical position. Valid values : top, bottom
actionTextStringCloseLabel of the action button
onActionFunctionSpecify a function that should be called when click on the action
transitionStringTransition name

License

This project is licensed under the MIT License - see the LICENSE.md file for details

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago