JSPM

@badu/vue-snackbar

2.9.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q26689F
  • License SEE LICENSE IN LICENCE

Snackbar vue component

Package Exports

  • @badu/vue-snackbar

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@badu/vue-snackbar) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

vue-snackbar

Plugin install

npm i @badu/vue-snackbar

Add to App.vue

import SnackbarNotif        from '@badu/vue-snackbar';
Vue.use(SnackbarNotif);

Options

title: message title
text: message description
type: message type > 'success', 'error', 'warning'
duration: message duration, in ms or it will be calculated from message length
cta: call to action (reload page)

Usage

from instance / component

this.$snackbar.show({
    msgTitle:'Someting is wrong',
    msgText:'Please try again',
    type: 'warning'
});

this.$snackbar.show({
    msgTitle:'Hello dear user',
    msgText:'You entered wrong password or username',
    duration: 2000,
    type: 'error'
});

this.$snackbar.show({
    msgTitle:'Hello dear user',
    msgText:'You have successfully logged in'
    type: 'success'
});

with reload call to action

this.$snackbar.show({
    msgTitle:'Hello dear user',
    msgText:'You entered wrong password or username',
    type: 'error',
    cta: true
});

global / store

Vue.$snackbarShow({
    msgTitle:'Hello dear user',
    msgText:'You have successfully logged in',
    type: 'success'
});