Closed this1-it closed 2 years ago
@this1-it Thanks for reporting, this plugin only supports Vue2 currently. We will be looking into adding Vue3 support in the future.
I've already done the porting in vue3, plugin is loaded but I was not able to test yet because I do not have a valid key
Instead of
export default OneSignalVuePlugin;
` I changed your plugin and exported a function as default
export default {
install: (app: any, options: any) => {
app.config.globalProperties.$OneSignal = OneSignalVue as IOneSignal;
}
}
import { createApp } from 'vue'
// this is my OneSignal plugin
import OneSignalVue from "@/onesignal"
const app = createApp(App)
app.use(OneSignalVue)
I think you can handle vue2 in method install like this app.prototype.$OneSignal = OneSignalVue as IOneSignal;
I see that dependencies are with vue2, but I give a try with vue3
plugin initialization is different, I'm doing:
then I got this exception, do you have any clue ? Uncaught TypeError: Cannot set properties of undefined (setting '$OneSignal')