diff --git a/src/index.js b/src/index.js index 480d21c..7ac556a 100644 --- a/src/index.js +++ b/src/index.js @@ -8,8 +8,8 @@ const Toasted = { } const Toast = new T(options); - Vue.component('toasted', ToastComponent); - Vue.toasted = Vue.prototype.$toasted = Toast; + app.component('toasted', ToastComponent); + app.config.globalProperties.$toasted = Toast; } }; diff --git a/types/index.d.ts b/types/index.d.ts index 14d43cb..add5424 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,5 +1,4 @@ -import { Vue, VueConstructor } from 'vue/types/vue' -import { PluginFunction } from "vue" +import { App, PluginFunction } from 'vue'; export interface ToastObject { // html element of the toast @@ -158,12 +157,8 @@ declare class ToastedPlugin { static install: PluginFunction } -declare module 'vue/types/vue' { - interface VueConstructor { - toasted: Toasted - } - - interface Vue { +declare module '@vue/runtime-core' { + interface ComponentCustomProperties { $toasted: Toasted } }