f / vue-wait

Complex Loader and Progress Management for Vue/Vuex and Nuxt Applications
MIT License
2k stars 101 forks source link

Usage in nuxtjs3 (plugin attempt) #123

Open ahoiroman opened 2 years ago

ahoiroman commented 2 years ago

Hello,

I am trying to use this in a early adoption of nuxt3. The vue-wait/nuxt-plugin does not work, so I tried to create my own plugin:

import { createVueWait } from 'vue-wait'

export default defineNuxtPlugin((nuxtApp) => {
    const VueWait = createVueWait({ registerComponent: false,})
    nuxtApp.vueApp.use(VueWait);

    return {
        provide: {
            wait: () => VueWait
        }
    }
})

But unfortunately, this gives me an error:

Unhandled Promise Rejection: TypeError: $wait.is is not a function. (In '$wait.is("test")', '$wait.is' is undefined)

when I try to access it like this:

const {$auth, $wait} = useNuxtApp();

console.log($wait.is('test'))
galaxyblur commented 1 year ago

@ahoiroman have you had any luck with this?