2019-10-25 12:59:50 +08:00
|
|
|
# Basic
|
2020-02-02 02:07:00 +08:00
|
|
|
Basic example of transfer. If you have tons of data, see next section.
|
2019-10-25 12:59:50 +08:00
|
|
|
```html
|
|
|
|
<n-transfer
|
|
|
|
ref="transfer"
|
|
|
|
v-model="value"
|
|
|
|
:options="options"
|
|
|
|
/>
|
|
|
|
```
|
|
|
|
```js
|
2020-02-02 02:07:00 +08:00
|
|
|
function createOptions () {
|
|
|
|
return Array.apply(null, { length: 100 }).map((v, i) => ({
|
|
|
|
label: 'Option' + i,
|
|
|
|
value: i,
|
2020-01-18 13:28:20 +08:00
|
|
|
disabled: i % 5 === 0
|
2019-10-25 12:59:50 +08:00
|
|
|
}))
|
|
|
|
}
|
|
|
|
|
2020-02-02 02:07:00 +08:00
|
|
|
function createValues () {
|
|
|
|
return Array.apply(null, { length: 50 }).map((v, i) => i)
|
2019-10-25 12:59:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
2020-02-02 02:07:00 +08:00
|
|
|
options: createOptions(),
|
|
|
|
value: createValues()
|
2019-10-25 12:59:50 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
```
|