Skip to main content

ion-list

列表由多行 items 组成,其中可以包含文本、按钮、切换、图标、缩略图等。列表通常包含具有相似数据内容的项目,例如图片和文本。

¥Lists are made up of multiple rows of items which can contain text, buttons, toggles, icons, thumbnails, and much more. Lists generally contain items with similar data content, such as images and text.

列表支持多种交互,包括滑动项目以显示选项、拖动到列表中的 reorder 项目以及删除项目。

¥Lists support several interactions including swiping items to reveal options, dragging to reorder items within the list, and deleting items.

基本用法

¥Basic Usage

插图列表

¥Inset List

inset 属性添加到列表将在列表周围应用边距。在 ios 模式下,它还会向列表添加圆角。

¥Adding the inset property to a list will apply margin around the list. In ios mode it will also add rounded corners to the list.

列表行

¥List Lines

lines 属性添加到列表将调整列表中所有项目的底部边框。将其设置为 "full" 将显示全宽边框,"inset" 将显示用左填充调整的边框,"none" 将不显示边框。如果在列表中的某个项目上设置了 lines 属性,则该属性将优先于列表中的属性。

¥Adding the lines property to a list will adjust the bottom borders of all of the items in the list. Setting it to "full" will display full width borders, "inset" will display borders adjusted with left padding, and "none" will show no borders. If the lines property is set on an item in a list, that will take priority over the property on the list.

属性

¥Properties

inset

DescriptionIf true, the list will have margin around it and rounded corners.
Attributeinset
Typeboolean
Defaultfalse

lines

DescriptionHow the bottom border should be displayed on all items.
Attributelines
Type"full" | "inset" | "none" | undefined
Defaultundefined

mode

DescriptionThe mode determines which platform styles to use.
Attributemode
Type"ios" | "md"
Defaultundefined

事件

¥Events

No events available for this component.

方法

¥Methods

closeSlidingItems

DescriptionIf ion-item-sliding are used inside the list, this method closes any open sliding item.

Returns true if an actual ion-item-sliding is closed.
SignaturecloseSlidingItems() => Promise<boolean>

CSS 阴影部分

¥CSS Shadow Parts

No CSS shadow parts available for this component.

CSS 自定义属性

¥CSS Custom Properties

No CSS custom properties available for this component.

插槽

¥Slots

No slots available for this component.