Skip to content

Usage inside vue-resource interceptor #6

@franc014

Description

@franc014

Hi,
I'm using vue-resource and I'd like to use vue-spinner inside interceptors to show/hide the spinner on any ajax request. I don't know if it's possible to reference a vue-spinner component inside the interceptor. I have done the following but with no success: (I'm using vueify)

var PulseLoader = require('vue-spinner/dist/vue-spinner.min').PulseLoader;

Vue.http.interceptors.push((request, next) => {
    this.loading = true;
   next((response) => {
        this.loading = false;
    });
});

new Vue({
    el: '#grid-manager',
   components: { 'pulse-loader': PulseLoader},

  ....and in the root vue instance i have:

<pulse-loader :loading="loading" :color="color" :size="size"></pulse-loader>

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions