h5页面
<script>
var app = new Vue({
el: '#app',
data: {
swiper: null,
carousel: [],
promotion: [],
cates: [],
//设置size初始为10
size:10,
},
mounted: function () {
//定义that用that.size获取size的值
var that=this;
getPromotion();
//秒表每秒请求一次
setInterval(function(){
//content是div类名
const el = document.querySelector('.content');
const offsetHeight = el.offsetHeight;
el.onscroll = () => {
const scrollTop = el.scrollTop;
const scrollHeight = el.scrollHeight;
if ((offsetHeight + scrollTop) - scrollHeight >= -1