Sfoglia il codice sorgente

DatePicker: fix scroll render bug (#1290)

kingwl 8 anni fa
parent
commit
c3aba68ecc
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  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() {