For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/zh/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/zh/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/zh/components/transfer.md.
v0.0.57
  • 简体中文
  • Transfer

    数据录入@rockshin/tao-ui

    在可选列表和已选列表之间移动记录。

    何时使用

    适合同时展示可选与已选内容的多选操作。应用应维护 targetKeys,并为记录提供稳定 key。

    示例

    受控目标列表

    勾选记录后通过中间按钮移动;禁用记录不可选择。

    390 × 640
    TSX

    受控勾选与事件

    selectedKeys 独立控制勾选状态;onChange 同时返回移动方向和记录 key。

    1/12 itemsSource
    0 itemsTarget
    • No data
    No records moved
    TSX

    多字段搜索

    filterOption 接收搜索词、记录和方向。可见标签可以与搜索值不同。

    12 itemsSource
    0 itemsTarget
    • No data
    TSX

    单向穿梭与分页

    oneWay 向右移动记录,并允许在目标列表逐条移除。分页分别作用于两侧列表。

    10 itemsSource
    • /3
    2 itemsTarget
    • Member 2
    • Member 4
    • /1
    TSX

    页脚与选择说明

    为两侧分别提供页脚,并通过 selectAllLabels 展示勾选数量。

    0 / 12 availableSource
    Choose team members
    0 / 0 selectedTarget
    • No data
    Members added to this project
    TSX

    自定义列表内容

    渲染函数提供 filteredItems、selectedKeys 和选择回调;自定义控件需遵循 disabled 状态。

    12 itemsSource
    0 itemsTarget
    TSX

    自定义 key、状态与禁用

    标识字段不叫 key 时可使用 rowKey;source 和 target 可分别设置语义样式。

    3 itemsSource
    0 itemsTarget
    • No data
    Select at least one team.
    TSX

    API

    Transfer

    属性说明类型默认值
    disabled是否禁用boolean | undefined-
    renderItem content; defaults to the title, or the key when the title is omitted.((item: T) => RenderResult) | undefined-