Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For anyone wanting to use this with vue3 #13

Open
lk77 opened this issue Apr 29, 2022 · 0 comments
Open

For anyone wanting to use this with vue3 #13

lk77 opened this issue Apr 29, 2022 · 0 comments

Comments

@lk77
Copy link

lk77 commented Apr 29, 2022

Hello,

i wanted to use this package with vue 3, but it's only working with vue 2, so i did this little trick to make it work :

app.use((app) => {
    let Vue = {
        mixin: (m) => {
            app.mixin(m);
        },
        prototype: {}
    };

    PubNubVue.install(Vue, {
        subscribeKey: null,
        ssl: true,
        uuid: null
    });

    Object.keys(Vue.prototype).forEach((key) => {
        app.config.globalProperties[key] = Vue.prototype[key]
    });
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant