Skip to content

Transfer

Transfer component provides two side-by-side panels that allow users to move items between them. It is commonly used for permission assignment, role association, and similar scenarios.


Basic Usage

Pass options via :data prop, bind the selected keys array with v-model. The disabled property in options disables that item.

vue

<script setup>
interface Option {
  key: number
  label: string
  disabled?: boolean
}

const data = ref<Option[]>(
  Array.from({ length: 15 }, (_, i) => ({
    key: i + 1,
    label: `Option ${i + 1}`,
    disabled: (i + 1) % 4 === 0,
  }))
)
const value = ref<number[]>([])
</script>

<TTransfer v-model="value" :data="data" />

With Initial Values

Assign initial values to v-model, and the right panel will contain the specified items by default.

vue

<script setup>
interface Option {
  key: number
  label: string
  disabled?: boolean
}

const data = ref<Option[]>(
  Array.from({ length: 15 }, (_, i) => ({
    key: i + 1,
    label: `Option ${i + 1}`,
    disabled: (i + 1) % 4 === 0,
  }))
)
const value = ref<number[]>([2, 4, 6, 8])
</script>

<TTransfer v-model="value" :data="data" />

Filterable

Set filterable to enable search filtering. By default it matches by the label field; use filter-method for custom logic.

vue

<TTransfer v-model="value" :data="data" filterable />

Keep Source Mode

Set the keep-source prop to keep all items visible in the left panel. Items moved to the right are shown as checked+disabled in the left panel, and become selectable again when moved back.

vue

<TTransfer v-model="value" :data="data" keep-source />

API

Props

PropTypeDefaultDescription
dataTransferOption[][]All options
model-value / v-model(string | number)[][]Selected keys array
filterablebooleanfalseEnable search filtering
filter-method(query: string, option: TransferOption) => booleanCustom filter function
filter-placeholderstring'Search'Search input placeholder
left-titlestring'Available'Left panel title
right-titlestring'Selected'Right panel title
empty-textstring'No data'Empty state text
keep-sourcebooleanfalseKeep source mode: left panel always shows all items; selected items appear checked+disabled

TransferOption

FieldTypeDescription
keystring | numberUnique identifier
labelstringDisplay text
disabledbooleanWhether disabled

Slots

SlotParametersDescription
default{ item: TransferOption, checked: boolean }Custom item rendering