dennisbruner / vue-native-notification

Vue.js plugin for native notifications
https://www.npmjs.com/package/vue-native-notification
MIT License
71 stars 13 forks source link

Property 'notification' does not exist on type 'VueConstructor<Vue>' #16

Open stravi opened 4 years ago

stravi commented 4 years ago

Hello, do you have type files for typescript?

I'm getting this error Property 'notification' does not exist on type 'VueConstructor<Vue>' when I trying to show a notification like this: Vue.notification.show(title, { body },{});

dezerb commented 3 years ago

you have to create somewhere in project vue.d.ts

import Vue from 'vue'
import { Notification } from 'vue-native-notification'

declare module 'vue/types/options' {
  interface ComponentOptions<V extends Vue> {
    notifications?: Notification;
  }
}

declare module 'vue/types/vue' {
  interface Vue {
    $notification: Notification;
  }
}