export default {
data() {
return {
timer:'',
ServiceMonitor:{ }
}
},
methods: {
async queryServiceMonitor(){
let res = await this.$api.queryServiceMonitor({ waitting: () => null,})
if (!res) {
return
}else{
this.ServiceMonitor=res
}
},
},
mounted(){
this.queryServiceMonitor()
this.timer=setInterval(this.queryServiceMonitor,5000)
},
computed: {},
beforeDestroy() {
if (this.timer) {
clearInterval(this.timer);
}
}
}
前端页面数据每隔5秒刷新一次
于 2023-10-13 10:08:20 首次发布