ankurk91 / vue-loading-overlay

Vue.js component for full screen loading indicator :cyclone:
https://ankurk91.github.io/vue-loading-overlay/
MIT License
1.25k stars 102 forks source link

Set Loader Options when using as Plugin #43

Closed bluezald closed 4 years ago

bluezald commented 4 years ago

Can we use the loader to set its global options when installing as plugin, like this:

Vue.use(Loading, {
  container: null,
  isFullPage: true,
  loader: 'dots'
})

so that when I call it, I can do this

this.$loading.show()

instead of

let loader = this.$loading.show({
      container: null,
      isFullPage: true,
      loader: 'dots'
    })
ankurk91 commented 4 years ago

The readme has everything you need.

https://github.com/ankurk91/vue-loading-overlay#global-configs

YusufcanY commented 2 years ago

When i use as plugin in Vue 3.2.24, I can't set global config for plugin,

app.use(VueLoading,{
    color: 'red',
    backgroundColor: '#f8f8',
    lockScroll: true,
});

It's just doesnt work.

But when define props in where I calling show function it works, how this happening?

ankurk91 commented 2 years ago

@YusufcanY

Please share a minimal re-production on codesandbox or jsfiddle

YusufcanY commented 2 years ago

Actually i got the problem in here. We can not define global config when using composition api. Am I right?

ankurk91 commented 2 years ago

you can not expect global config when using it via composition api

YusufcanY commented 2 years ago

yea i got that thanks for the time