From 9f5a643a16e08aa5b002186d5c9b670b949044fe Mon Sep 17 00:00:00 2001 From: 梁灏 <admin@aresn.com> Date: Tue, 7 Nov 2017 17:54:36 +0800 Subject: [PATCH] fixed #2019 --- src/components/transfer/list.vue | 1 + src/components/transfer/transfer.vue | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/components/transfer/list.vue b/src/components/transfer/list.vue index 12236c9..2137281 100644 --- a/src/components/transfer/list.vue +++ b/src/components/transfer/list.vue @@ -111,6 +111,7 @@ if (item.disabled) return; const index = this.checkedKeys.indexOf(item.key); index > -1 ? this.checkedKeys.splice(index, 1) : this.checkedKeys.push(item.key); + this.$parent.handleCheckedKeys(); }, updateFilteredData () { this.showItems = this.data; diff --git a/src/components/transfer/transfer.vue b/src/components/transfer/transfer.vue index 3a9a5a6..4983549 100644 --- a/src/components/transfer/transfer.vue +++ b/src/components/transfer/transfer.vue @@ -238,6 +238,11 @@ }, handleRightCheckedKeysChange (keys) { this.rightCheckedKeys = keys; + }, + handleCheckedKeys () { + const sourceSelectedKeys = this.getValidKeys('left'); + const targetSelectedKeys = this.getValidKeys('right'); + this.$emit('on-selected-change', sourceSelectedKeys, targetSelectedKeys); } }, watch: { -- libgit2 0.21.4