naive-ui/demo/documentation/components/transfer/enUS/basic.demo.md
2020-10-06 03:04:22 +08:00

545 B

Basic

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

<n-transfer
  ref="transfer"
  v-model:value="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()
    }
  },
}