Skip to content

Commit c47dd95

Browse files
committed
Improve example
1 parent 1d956e4 commit c47dd95

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

example/index.html

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
border-top: 1px solid #fff;
2020
border-bottom: 1px solid #e3e3e3;
2121
}
22-
.example-list-item:before{
22+
.example-list-item::before{
2323
content: 'Line: ';
2424
}
2525
</style>
@@ -38,15 +38,19 @@
3838
},
3939
methods: {
4040
onInfinite: function () {
41-
setTimeout(function () {
42-
var temp = [];
43-
for (var i = this.list.length; i <= this.list.length + 10; i++) {
44-
temp.push(i);
45-
}
41+
if (this.list.length > 200) {
42+
this.$refs.infiniteLoading.$emit('$InfiniteLoading:complete');
43+
} else {
44+
setTimeout(function () {
45+
var temp = [];
46+
for (var i = this.list.length; i <= this.list.length + 10; i++) {
47+
temp.push(i);
48+
}
4649

47-
this.list = this.list.concat(temp);
48-
this.$refs.infiniteLoading.$emit('$InfiniteLoading:loaded');
49-
}.bind(this), 1000);
50+
this.list = this.list.concat(temp);
51+
this.$refs.infiniteLoading.$emit('$InfiniteLoading:loaded');
52+
}.bind(this), 1000);
53+
}
5054
}
5155
}
5256
});

0 commit comments

Comments
 (0)