跳到主要内容
版本:v6

ion-reorder-group

重新排序组(Reorder group)是使用重新排序(reorder)组件的项目的容器。当用户拖动项目并将其放到新位置时,会分发 ionItemReorder 事件。应实现该事件的处理程序来调用 complete 方法。

ionItemReorder 事件的 detail 属性包含有关重新排序操作的所有相关信息,包括 fromto 索引。在重新排序的上下文中,项目从一个索引移动到另一个索引。有关重新排序组的用法示例,请参阅重新排序(reorder)文档。

接口

ItemReorderEventDetail

interface ItemReorderEventDetail {
from: number;
to: number;
complete: (data?: boolean | any[]) => any;
}

ItemReorderCustomEvent

虽然不是必需的,但此接口可以替代 CustomEvent 接口,为此组件发出的 Ionic 事件提供更强的类型支持。

interface ItemReorderCustomEvent extends CustomEvent {
detail: ItemReorderEventDetail;
target: HTMLIonReorderGroupElement;
}

属性

disabled

说明If true, the reorder will be hidden.
属性disabled
类型boolean
默认值true

事件

Name说明冒泡
ionItemReorderEvent that needs to be listened to in order to complete the reorder action. Once the event has been emitted, the complete() method then needs to be called in order to finalize the reorder action.true

方法

complete

说明Completes the reorder operation. Must be called by the ionItemReorder event.

If a list of items is passed, the list will be reordered and returned in the proper order.

If no parameters are passed or if true is passed in, the reorder will complete and the item will remain in the position it was dragged to. If false is passed, the reorder will complete and the item will bounce back to its original position.
签名complete(listOrReorder?: boolean | any[]) => Promise<any>
参数listOrReorder: A list of items to be sorted and returned in the new order or a boolean of whether or not the reorder should reposition the item.

CSS 阴影部分

该组件没有可用的 CSS 阴影部分。

CSS 自定义属性

该组件没有可用的 CSS 自定义属性。

插槽

该组件没有可用的插槽。