值域标准
标准文件
新增
编辑
删除
审核通过
正在审核
审核不通过
发布
失效
js
methods: {
mouseenter(){
var self = this
clearInterval(self.interval)
self.interval = null
},
mouseleave(){
var self = this
this.interval = setInterval(self.scroll, 1000);
},
//table滚动
scroll() {
this.animate = !this.animate;
var that = this; // 在异步函数中会出现this的偏移问题,此处一定要先保存好this的指向
setTimeout(function() {
that.tableData.push(that.tableData[0]);
that.tableData.shift();
that.animate = !that.animate;
setTimeout(function() {}, 5000); // 这个地方如果不把animate 取反会出现消息回滚的现象,此时把ul 元素的过渡属性取消掉就可以完美实现无缝滚动的效果了
}, 2000);
},
}
data() {
return {
animate: true,
interval: null
};
},
created() {
this.interval = setInterval(this.scroll, 1000);
},
原文:https://www.cnblogs.com/chaixiaoxia/p/11190549.html