How to abandon the previous request using axios, in vue

axios the following forms are injected into vue

const asiosInstance = axios.create({
    baseURL: apiUrl,
    timeout: 10000
})
Vue.prototype.$http = asiosInstance

use it as follows

this.$http.get("xx").then()

my current scenario is that there is a filtering feature in which the filter conditions change when the user clicks, and then requests data immediately, but the backend interface is very slow abroad, and when the user clicks quickly, multiple requests are initiated. When these requests respond, the page will appear how many refresh data, which feels very uncomfortable.
so I think the current this.$http.get ("xx") ignores the previous request each time, while other locations, such as this.$http.get (" yy") , are not affected,

.
Mar.10,2021

look at axios's cancelToken


the easiest thing to do is to mark

with a variable.
...
if(this.requesting){
    this.requesting = false;
    this.$http.get('xx').then(()=>{
        this.requesting = true;
        ...
    });
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5429e-4526c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5429e-4526c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?