mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
31 lines
554 B
Markdown
31 lines
554 B
Markdown
# 基础用法
|
|
穿梭框的基础用法。如果你有一大堆数据,看下一个例子。
|
|
```html
|
|
<n-transfer
|
|
ref="transfer"
|
|
v-model="value"
|
|
:options="options"
|
|
/>
|
|
```
|
|
```js
|
|
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()
|
|
}
|
|
},
|
|
}
|
|
``` |