diff --git a/src/packages/__VUE/list/doc.en-US.md b/src/packages/__VUE/list/doc.en-US.md index 088e0e2429..4812430963 100644 --- a/src/packages/__VUE/list/doc.en-US.md +++ b/src/packages/__VUE/list/doc.en-US.md @@ -98,7 +98,7 @@ body { |--------------|----------------------------------|--------|------------------| | height | The height of the list item | Number | `50` | | list-data | List data | any[] | `[]` | -| container-height `v3.1.19` | Container height | Number | `Visual area height` | +| container-height `v3.1.19` | Container height(The maximum value cannot exceed the viewable area) | Number | `Visual area height` | ### Slot diff --git a/src/packages/__VUE/list/doc.md b/src/packages/__VUE/list/doc.md index 6a1eee5f22..057c17bd04 100644 --- a/src/packages/__VUE/list/doc.md +++ b/src/packages/__VUE/list/doc.md @@ -98,7 +98,7 @@ body { |--------------|----------------------------------|--------|------------------| | height | 列表项的高度 | Number | `50` | | list-data | 列表数据 | any[] | `[]` | -| container-height `v3.1.19` | 容器高度 | Number | `可视区高度` | +| container-height `v3.1.19` | 容器高度(最大值不能超过可视区) | Number | `可视区高度` | ### Slot diff --git a/src/packages/__VUE/list/index.scss b/src/packages/__VUE/list/index.scss index 608364122d..c643db4d55 100644 --- a/src/packages/__VUE/list/index.scss +++ b/src/packages/__VUE/list/index.scss @@ -1,6 +1,5 @@ .nut-list { width: 100%; - height: 100%; overflow: scroll; position: relative; -webkit-overflow-scrolling: touch; diff --git a/src/packages/__VUE/list/index.taro.vue b/src/packages/__VUE/list/index.taro.vue index 8ac2d6e35e..967b519fd0 100644 --- a/src/packages/__VUE/list/index.taro.vue +++ b/src/packages/__VUE/list/index.taro.vue @@ -2,7 +2,7 @@ { + return Math.min(props.containerHeight, clientHeight); + }); + const visibleCount = computed(() => { - return Math.ceil(props.containerHeight / props.height); + return Math.ceil(getContainerHeight.value / props.height); }); const end = computed(() => { @@ -98,6 +103,7 @@ export default create({ listHeight, visibleData, classes, + getContainerHeight, handleScrollEvent }; } diff --git a/src/packages/__VUE/list/index.vue b/src/packages/__VUE/list/index.vue index 91980e1a26..3aa7cb3686 100644 --- a/src/packages/__VUE/list/index.vue +++ b/src/packages/__VUE/list/index.vue @@ -1,17 +1,18 @@