内部方法setInterval(函数,定时时间)
5000是5秒,每5秒调一次接口
methods: {
// 测试函数
testHtml() {
console.log("测试")
},
mounted() {
//定时任务方法
this.$nextTick(() => {
setInterval(this.testHtml, 5000);
});
},
内部方法setInterval(函数,定时时间)
5000是5秒,每5秒调一次接口
methods: {
// 测试函数
testHtml() {
console.log("测试")
},
mounted() {
//定时任务方法
this.$nextTick(() => {
setInterval(this.testHtml, 5000);
});
},