Parcourir la source

DatePicker: fix scroll render bug (#1290)

kingwl il y a 8 ans
Parent
commit
c3aba68ecc
1 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. 5 3
      packages/date-picker/src/basic/time-spinner.vue

+ 5 - 3
packages/date-picker/src/basic/time-spinner.vue

@@ -136,10 +136,12 @@
       },
 
       handleScroll(type) {
-        const ajust = {};
+        window.setTimeout(() => {
+          const ajust = {};
 
-        ajust[`${type}s`] = Math.min(Math.floor((this.$refs[type].scrollTop - 80) / 32 + 3), 59);
-        this.$emit('change', ajust);
+          ajust[`${type}s`] = Math.min(Math.floor((this.$refs[type].scrollTop - 80) / 32 + 3), 59);
+          this.$emit('change', ajust);
+        }, 0);
       },
 
       ajustScrollTop() {