Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

A tiny vueJS plugin to intercept every ajax request.

The component intercept every ajax requisition, it doesn't matter which component you use [Axios, Vue-resourse, vanilla JS or any other].

With that you can implement any kind of control you need, validate users, control progress, or give an easy feedback for the users.

Requirements

Installation

$ npm install vue-ajax-intercept --save

Usage

<script>
import ajaxIntercept from 'vue-ajax-intercept'

export default {
  name: 'app',
  methods: {
    start(status){
      console.log(status); //XMLHttpRequest object
    },
    finish(status){
      console.log(status); //XMLHttpRequest object
    }
  },
  components: { ajaxIntercept }
}

</script>
<template>
  <div>
    <ajax-intercept @start="start" @finish="finish" ></ajax-intercept>  
	<router-view></router-view>
  </div>
</template>

License

The MIT License

About

A tiny vueJS plugin to intercept every ajax request

Resources

Releases

No releases published

Packages

No packages published