Skip to content

Commit a436841

Browse files
committed
Use dataSources.length path to watch change
1 parent 096643b commit a436841

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ const VirtualList = Vue.component('virtual-list', {
2626
},
2727

2828
watch: {
29-
dataSources (newValue, oldValue) {
30-
if (newValue.length !== oldValue.length) {
31-
this.virtual.updateParam('uniqueIds', this.getUniqueIdFromDataSources())
32-
this.virtual.handleDataSourcesChange()
33-
}
29+
'dataSources.length' () {
30+
this.virtual.updateParam('uniqueIds', this.getUniqueIdFromDataSources())
31+
this.virtual.handleDataSourcesChange()
3432
},
3533

3634
start (newValue) {

0 commit comments

Comments
 (0)