1、只调用一次 setTimeout(() => { // 要调用的方法 this.tofood() }, 4000); 2、根据设置的时间循环调用 setInterval(() => { this.getStuLeaveInfo(); }, 1000 * 60 * 5);