Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created September 19, 2017 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/c2daec85786bdbd89a6a1dc3a47d33e6 to your computer and use it in GitHub Desktop.
Save uno-de-piera/c2daec85786bdbd89a6a1dc3a47d33e6 to your computer and use it in GitHub Desktop.
import VueNotifications from 'vue-notifications';
import miniToastr from 'mini-toastr';
window.Vue.use(BlockUI);
const toastTypes = {
success: 'success',
error: 'error',
info: 'info',
warn: 'warn'
};
miniToastr.init({types: toastTypes});
function toast ({title, message, type, timeout, cb}) {
return miniToastr[type](message, title, timeout, cb)
}
const options = {
success: toast,
error: toast,
info: toast,
warn: toast
};
window.Vue.use(VueNotifications, options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment