perf(sticky): avoid set data if nothing change (#3879)

This commit is contained in:
rex 2020-12-18 16:10:11 +08:00 committed by GitHub
parent 2390413915
commit d5e4cf9ff0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,7 +108,9 @@ VantComponent({
return prev; return prev;
}, {}); }, {});
if (Object.keys(diff).length > 0) {
this.setData(diff); this.setData(diff);
}
this.$emit('scroll', { this.$emit('scroll', {
scrollTop: this.scrollTop, scrollTop: this.scrollTop,