Browse Source

fix(list): 列表渲染缺少最后一条数据#2162

suzigang 2 years ago
parent
commit
64a3c5c3e4
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/packages/__VUE/list/index.taro.vue
  2. 1 1
      src/packages/__VUE/list/index.vue

+ 1 - 1
src/packages/__VUE/list/index.taro.vue

@@ -98,7 +98,7 @@ export default create({
     });
 
     const end = computed(() => {
-      return Math.min(state.originStartIndex + visibleCount.value + props.bufferSize, state.list.length - 1);
+      return Math.min(state.originStartIndex + visibleCount.value + props.bufferSize, state.list.length);
     });
 
     const classes = computed(() => {

+ 1 - 1
src/packages/__VUE/list/index.vue

@@ -65,7 +65,7 @@ export default create({
     });
 
     const end = computed(() => {
-      return Math.min(state.originStartIndex + visibleCount.value + props.bufferSize, state.list.length - 1);
+      return Math.min(state.originStartIndex + visibleCount.value + props.bufferSize, state.list.length);
     });
 
     const classes = computed(() => {