From ee04cafad5dbc981142689a77a68b669d4788ea6 Mon Sep 17 00:00:00 2001 From: Dennis Bruner Date: Sat, 26 Aug 2017 21:54:52 +0200 Subject: [PATCH] Add readme --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f941941 --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +# vue-native-notification + +Vue.js plugin for native notifications + +## Install + +``` +npm install --save vue-native-notification +``` + +## Usage + +### Add plugin + +```javascript +import Vue from 'vue' +import VueNativeNotification from 'vue-native-notification' + +Vue.use(VueNativeNotification, { + // Automatic permiossion request before + // showing notification (default: true) + requestOnNotify: true +}) +``` + +### Show notification + +```html + + + + + +``` + +### Manual permission request + +You can manually request users permission with: + +```javascript +// Global +Vue.notification.requestPermission() + .then(console.log) // Prints "granted", "denied" or "default" + +// Component +this.$notification.requestPermission() + .then(console.log) +``` + +## License + +[MIT](LICENSE.md) \ No newline at end of file