naive-ui/demo/documentation/components/transfer/enUS/basic.md
2020-02-02 02:07:00 +08:00

539 B

Basic

Basic example of transfer. If you have tons of data, see next section.

<n-transfer
  ref="transfer"
  v-model="value"
  :options="options"
/>
function createOptions () {
  return Array.apply(null, { length: 100 }).map((v, i) => ({
    label: 'Option' + i,
    value: i,
    disabled: i % 5 === 0
  }))
}

function createValues () {
  return Array.apply(null, { length: 50 }).map((v, i) => i)
}

export default {
  data () {
    return {
      options: createOptions(),
      value: createValues()
    }
  },
}