本篇Codelab使用Scroll组件、List组件以及LazyForEach组件实现一个商品列表的页面。
| Files | Last commit | Last update |
|---|---|---|
| 2 years ago | ||
| 9 months ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 2 years ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 2 years ago | ||
| 1 year ago |
Commodity List
Introduction
Based on ArkTS, learn how to use the List component to implement lazy loading, pull-to-refresh, and bounce effect when the list reaches the bottom.

Concepts
- Scroll: a component that is used to scroll the content when a component layout exceeds the viewport of its parent component.
- List: a component that provides a series of list items with the same width. It supports presentations of the same type of data in a multiple and coherent row style, for example, images or text.
- Tabs: a container component that allows you to switch between content views through tabs. Each tab corresponds to a content view.
- LazyForEach: a component that iterates data from provided data sources and creates corresponding components during each iteration.
Permissions
N/A
How to Use
- Touch the Featured tab page and pull down to refresh the page.
- Drag up the page until you see "No more content" at the bottom of the page. The page bounces back to the original position when you release your finger.
Constraints
- The sample is only supported on Huawei phones with standard systems.
- The HarmonyOS version must be HarmonyOS 5.0.5 Release or later.
- The DevEco Studio version must be DevEco Studio 6.0.2 Release or later.
- The HarmonyOS SDK version must be HarmonyOS 6.0.2 Release SDK or later.