notivuecation

Promise-based alert/confirm modal for Vue.js. Results are logged to the console. Note that this is not a demo to show the looks of the notifications, the styling is completely up to you.

init

import notivuecation from 'notivuecation';

Vue.use(notivuecation);

basic alert/confirm

Using predefined button labels, you can quickly open a confirm or alert popup by just supplying the message.

confirm('Are you sure you want to do this?');
alert('Please click ok');

custom alert/confirm

Send an object instead of a string to define title, message and button labels.

confirm({
  message: 'Are you sure you want to do this?',
  confirm: 'Yes!',
  cancel: 'Hell no',
});

alert({
  title: 'Error!',
  message: 'Something went wrong',
  confirm: 'Bummer',
});

notify

If you want fully custom buttons, you can call notify directly and specify all buttons.

notify({
  title: 'Custom title',
  message: 'Custom message',
  buttons: [
    {label: 'option #1', value: 1},
    {label: 'option #2', value: 2},
    {label: 'option #3', value: 3},
  ]
})

queue

Every notification will be added to the queue and removed if closed, so multiple notifications may appear sequentially. Clicking the button below will trigger 3 confirmations, each one added a second after the previous one.