Preview Updated 2026-05-10

Transfer

Two lists with arrows in between to move items between "available" and "selected". Common for permission assignment and field selection.

Basic usage

dataSource is the full set; v-model / value is the array of selected keys. Each column has a select-all / invert checkbox; the arrow buttons move the current column’s checked items to the other side. searchable adds a search box on top of each column.

0 / 5
0 / 2
已选 keys:monitor, billing
<CfTransfer :data-source="data" v-model="target" searchable />
<CfTransfer dataSource={data} value={target} onChange={setTarget} searchable />

API

PropTypeDefaultDescription
dataSourceTransferItem[]Full item list
value / modelValuestring[]Controlled “selected” key array
defaultValuestring[][]Uncontrolled initial selected keys
titles[string, string]['Available', 'Selected']Titles for the two columns
searchablebooleanfalseShow search boxes

TransferItem

FieldTypeDescription
keystringUnique key
labelstringDisplay text
disabledbooleanDisabled, cannot be checked or moved

Events: onChange(keys) — fired when the selected keys array changes.

反馈与讨论

Transfer · Discussion

0
0 / 600
一键发送
正在加载评论...