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