3๐
โ
You can do something in the mounted hook:
mounted(){
this.interval = setInterval(() => {
axios.get(this.my_url).then(res => { /* do something */});
}, 30000 );
},
data(){
return {
interval: undefined,
my_url: undefined
}
}
setInterval is a javascript function that allow you to run a function every predefined milliseconds. You can cancel it later with the following command: clearInterval(this.interval). You can also change my_url when you want ๐
๐คMorgan Le Floc'h
Source:stackexchange.com