data() {
retuen{
time:null //定时名
}
}
mounted() {
this.gitList(); //列表
this.time = setInterval(() =>{ //应用setInterval来刷新getList()
this.getList();
},1000*60); //一分钟
}
methods: {},
//清除定时器
beforDesroy() {
clearIntreval(this.time);
this.time = null;
},
小弟个人见解,如有问题希望各位大佬品论改错!!! 有雷同麻烦通知自行删除加粗样式