b2nil / taro-ui-vue3

采用 Vue 3.0 重写的 Taro UI 组件库
https://b2nil.github.io/taro-ui-vue3/
MIT License
160 stars 51 forks source link

AtVirtualScroll 可视区域行数计算错误 #58

Closed b2nil closed 3 years ago

b2nil commented 3 years ago

问题描述

AtVirtualScroll 可视区域行数计算错误

版本信息

v1.0.0-alpha.13

涉及的平台

小程序 h5

代码

function getLast(first: number): number {
  // parseInt 笔误,导致 height 值固定不变
  const height = parseInt(`${props.height || 0, 10}`) || elRef.value.$el.clientHeight

  return first + Math.ceil(height / __itemHeight.value)
}
b2nil commented 3 years ago

d76edcdc21b76c6e6443a94020cfd36a709564b9 移除 viewport 属性,由 getLast 方法自动计算 viewport 所显示的行数。