1.0.4 • Published 7 years ago

vue-ajax-intercept v1.0.4

Weekly downloads
13
License
MIT
Repository
github
Last release
7 years ago

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