vue-native-notification icon indicating copy to clipboard operation
vue-native-notification copied to clipboard

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

Open stravi opened this issue 4 years ago • 1 comments

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 },{});

stravi avatar Sep 16 '20 08:09 stravi

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;
  }
}

dezerb avatar Feb 22 '21 19:02 dezerb