From 0af59b4e8da989770b97222fc344e7e6005961d2 Mon Sep 17 00:00:00 2001 From: JiwenBai Date: Mon, 23 Mar 2020 19:47:09 +0800 Subject: [PATCH 1/2] fixed: transfer bug --- .../components/transfer/zhCN/basic.md | 41 ++-- src/Transfer/src/Transfer.vue | 204 +++++++++++++----- 2 files changed, 172 insertions(+), 73 deletions(-) diff --git a/demo/documentation/components/transfer/zhCN/basic.md b/demo/documentation/components/transfer/zhCN/basic.md index 193886141..34dda8eee 100644 --- a/demo/documentation/components/transfer/zhCN/basic.md +++ b/demo/documentation/components/transfer/zhCN/basic.md @@ -1,31 +1,38 @@ # 基础用法 + 穿梭框的基础用法。如果你有一大堆数据,看下一个例子。 + ```html - + ``` + ```js -function createOptions () { - return Array.apply(null, { length: 100 }).map((v, i) => ({ - label: 'Option' + i, +function createOptions() { + return Array.apply(null, { length: 10 }).map((v, i) => ({ + label: "Option" + i, value: i, disabled: i % 5 === 0 - })) + })); } -function createValues () { - return Array.apply(null, { length: 50 }).map((v, i) => i) +function createValues() { + return Array.apply(null, { length: 5 }).map((v, i) => i); } export default { - data () { + data() { return { - options: createOptions(), - value: createValues() - } + options: [], + value: [] + }; }, -} -``` \ No newline at end of file + created() { + setTimeout(() => { + this.options = createOptions(); + }, 3000); + setTimeout(() => { + this.value = createValues(); + }, 5000); + } +}; +``` diff --git a/src/Transfer/src/Transfer.vue b/src/Transfer/src/Transfer.vue index 7bcd6ff5d..692d6b67a 100644 --- a/src/Transfer/src/Transfer.vue +++ b/src/Transfer/src/Transfer.vue @@ -10,7 +10,11 @@
- +
{{ sourceTitle || localeNamespace.sourceTitle }} @@ -22,7 +26,12 @@ @mouseleave="handleSourceListMouseLeave" >
- +