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

Global configuration is not used #107

Closed
jmsanzg opened this issue Sep 5, 2022 · 1 comment
Closed

Global configuration is not used #107

jmsanzg opened this issue Sep 5, 2022 · 1 comment

Comments

@jmsanzg
Copy link

jmsanzg commented Sep 5, 2022

I'm submitting a....

[X] Bug report
[ ] Feature request
[ ] Other, please describe

Tell about your platform

  • Vue.js version : 3.2.37
  • Browser name and version : Chrome 105.0
  • This package version : 5.0.3

Current behavior
Defining a global/default configuration doesn't work.

Expected behavior
Define global / default configuration that will be used by every instance of loading created.

Minimal reproduction of the problem with instructions

Inside main.js file:

import App from 'App.vue'
import VueLoading from "vue-loading-overlay"
import 'vue-loading-overlay/dist/vue-loading.css'
...
app.use(createPinia())
   .use(router)
   .use(VueLoading, { color: '#4862A0', backgroundColor: '#000000', opacity: 0.8 }, {})
   .provide('axios', axios)
   .mount('#app');

Inside my component:

<script setup>
import { useLoading } from 'vue-loading-overlay'
import { onMounted, inject, ref } from 'vue'
const loading = useLoading();
const axios = inject('axios');
const items = ref([]);

onMounted(async () => {
    const loader = loading.show(); // The loader works BUT it takes the default config, not the one defined by me
    try {
        let res = await axios.get('/api/private/xxxxx/');
        items.value = res.data;
    } catch (error) {
    }
    loader.hide();
})
</script>
@ankurk91
Copy link
Owner

ankurk91 commented Sep 5, 2022

Duplicate of
#106

@ankurk91 ankurk91 marked this as a duplicate of #106 Sep 5, 2022
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

2 participants