List_commodity:基于HarmonyOS的商品列表展示项目

本篇Codelab使用Scroll组件、List组件以及LazyForEach组件实现一个商品列表的页面。

Branch1Tags0
FilesLast commitLast 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

  1. Touch the Featured tab page and pull down to refresh the page.
  2. 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

  1. The sample is only supported on Huawei phones with standard systems.
  2. The HarmonyOS version must be HarmonyOS 5.0.5 Release or later.
  3. The DevEco Studio version must be DevEco Studio 6.0.2 Release or later.
  4. The HarmonyOS SDK version must be HarmonyOS 6.0.2 Release SDK or later.

Introduction

本篇Codelab使用Scroll组件、List组件以及LazyForEach组件实现一个商品列表的页面。

Customize your domain