记得给父级给"高度"
v-infinite-scroll="load"
infinite-scroll-disabled="disabled"
>
{{ i }}
加载中...
没有更多了
export default {
data() {
return {
count: 10,
loading: false,
};
},
computed: {
noMore() {
return this.count >= 20;
},
disabled() {
return this.loading || this.noMore;
},
},
methods: {
load() {
this.loading = true;
setTimeout(() => {
this.count += 2;
this.loading = false;
}, 2000);
},
},
};
.mk {
width: 100%;
height: 60vh;
}
.list {
width: 100%;
}
.li {
margin-top: 20px;
width: 100%;
height: 100px;
background-color: rgb(166, 65, 65);
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)