Skip to content

Commit 079a95a

Browse files
committed
Modify the example from $refs.x.$emit to $state argument
1 parent e4d9511 commit 079a95a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

example/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
list: []
3939
},
4040
methods: {
41-
infiniteHandler: function () {
41+
infiniteHandler: function ($state) {
4242
if (this.list.length > 200) {
43-
this.$refs.infiniteLoading.$emit('$InfiniteLoading:complete');
43+
$state.complete();
4444
} else {
4545
setTimeout(function () {
4646
var temp = [];
@@ -49,7 +49,7 @@
4949
}
5050

5151
this.list = this.list.concat(temp);
52-
this.$refs.infiniteLoading.$emit('$InfiniteLoading:loaded');
52+
$state.loaded();
5353
}.bind(this), 1000);
5454
}
5555
}

0 commit comments

Comments
 (0)