vue-native-notification
Vue.js plugin for native notifications
Install
npm install --save vue-native-notification
Usage
Add plugin
Vue
Show notification
Show notification
Manual permission request
You can manually request users permission with:
// GlobalVuenotification // Prints "granted", "denied" or "default" // Componentthis$notification
Events
https://developer.mozilla.org/en-US/docs/Web/API/Notification
We now supports all notifications events
onerror
https://developer.mozilla.org/en-US/docs/Web/API/Notification/onerror
Is an empty function. Nothing will be executed
onclick
https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclick
When notification is clicked, we set the focus on the context browser and close the notification
onclose
https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclose
Is an empty function. Nothing will be executed
onshow
https://developer.mozilla.org/en-US/docs/Web/API/Notification/onshow
Is an empty function. Nothing will be executed
Usage
const notification = title: 'Your title' options: body: 'This is an example!' events: { console; } { console; } { console; } { console; } this$notification