Open limsocheat opened 1 year ago
As far as I know there is no composable for vue wait but you can create one easily:
import { getCurrentInstance } from 'vue'
export function useWait() {
const instance = getCurrentInstance()
// If `getCurrentInstance` is called outside of a Vue component setup function, it will return `null`.
if (!instance) {
throw new Error('useCore must be called within a Vue component setup function.')
}
// The `instance` object has a `proxy` property, which is the component's public instance.
const { proxy } = instance
// `proxy.$wait` gives us access to the global `$wait` object provided by vue-wait
return proxy.$wait
}
Then to use it:
const wait = useWait()
wait.start('loader name')
Is there any document for Vue3 Composition API?