vue-ajax-intercept
v1.0.4
Published
A tiny vueJS plugin to intercept every ajax request
Downloads
54
Maintainers
Readme
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>