data () {
return {
theme:theme,
timer:null, 定时器名称
// 滚动字母
digits:123456,
调用
mounted () {
// 延时定时器
this.timer=setInterval(()=>{
// console.log(this.digits);
// 刷新页面
// window.location.reload()
this.digits++
// console.log(this.digits++)
},1000)
离开页面时清除定时器
beforeDestroy() {
// 清除定时器
clearInterval(this.timer);
this.timer =null;
网友评论