vue数据定时刷新
async mounted() {this.refresh() ;},methods: {refresh(){this.timer = setTimeout(async () => {await this.refresh();console.log("定时刷新!!!")}, 5000) //设置五秒后刷新},}
·
async mounted() {
this.refresh() ;
},
methods: {
refresh(){
this.timer = setTimeout(async () => {
await this.refresh();
console.log("定时刷新!!!")
}, 5000) //设置五秒后刷新
},
}
更多推荐
已为社区贡献1条内容
所有评论(0)