2
0
mirror of https://github.com/tusen-ai/naive-ui.git synced 2025-02-23 13:31:06 +08:00
naive-ui/demo/documentation/components/transfer/zhCN/large-data.demo.md

32 lines
665 B
Markdown
Raw Normal View History

2020-02-02 02:07:00 +08:00
# 一大堆数据
2020-02-04 18:39:05 +08:00
如果你有一大堆数据,你可能想让它快一点。设定 `virtual-scroll` 来使用一个飞快的穿梭框(会关掉那个傻乎乎的动画)。
2020-02-02 02:07:00 +08:00
```html
<n-transfer
ref="transfer"
2020-10-06 03:04:22 +08:00
v-model:value="value"
2020-02-02 02:07:00 +08:00
:options="options"
virtual-scroll
/>
```
```js
function createOptions () {
2020-02-04 18:39:05 +08:00
return Array.apply(null, { length: 20000 }).map((v, i) => ({
2020-02-02 02:07:00 +08:00
label: 'Option' + i,
value: i,
disabled: i % 5 === 0
}))
}
function createValues () {
return Array.apply(null, { length: 10000 }).map((v, i) => i)
}
export default {
data () {
return {
options: createOptions(),
value: createValues()
}
}
2020-02-02 02:07:00 +08:00
}
```