From 21738da1e7feed77337c07149b9ebf36a1e341e7 Mon Sep 17 00:00:00 2001 From: honorsuper Date: Mon, 8 Aug 2022 12:55:15 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20transform=E7=BB=84=E4=BB=B6=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=80=BC=E4=B8=8D=E5=9C=A8options=E4=B8=AD=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/transfer/src/use-transfer-data.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/transfer/src/use-transfer-data.ts b/src/transfer/src/use-transfer-data.ts index 1990b415adc..4e9afb64234 100644 --- a/src/transfer/src/use-transfer-data.ts +++ b/src/transfer/src/use-transfer-data.ts @@ -28,7 +28,9 @@ export function useTransferData (props: UseTransferDataProps) { const targetOptionsRef = computed(() => { const optionMap = optionsMapRef.value - return (mergedValueRef.value || []).map((v) => optionMap.get(v)) as Option[] + return (mergedValueRef.value || []) + .map((v) => optionMap.get(v)) + .filter((item) => item !== undefined) as Option[] }) const srcPatternRef = ref('') From fbf06fc99486014fdabc3cfafbac36b6202242e6 Mon Sep 17 00:00:00 2001 From: honorsuper Date: Mon, 8 Aug 2022 13:01:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.en-US.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index b0f8738a8ee..b1bf4419ede 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -8,6 +8,7 @@ - Fix `n-tree` can't expand node with `type='group'`, closes [#3388](https://github.com/TuSimple/naive-ui/issues/3388). - Fix `n-pagination`'s' `default-page-size` prop doesn't follows `page-sizes` prop, closes [#3369](https://github.com/TuSimple/naive-ui/issues/3369). - Added `exports` field in package.json [3410](https://github.com/TuSimple/naive-ui/pull/3410) +- 修复 `n-transfer`中初始值不在选项列表报错 ### Feats From a0dd819ab8b6608810ad2f913f0af71a809c8688 Mon Sep 17 00:00:00 2001 From: honorsuper Date: Mon, 8 Aug 2022 13:01:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.zh-CN.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 4b81674bac5..5f86ec6646f 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -8,6 +8,7 @@ - 修复 `n-tree` 在传入的节点数据中包含 `type='group'` 时无法展开,关闭 [#3388](https://github.com/TuSimple/naive-ui/issues/3388) - 修复 `n-pagination` 的 `default-page-size` 没有跟随 `page-sizes` prop,关闭 [#3369](https://github.com/TuSimple/naive-ui/issues/3369) - Added `exports` field in package.json [3410](https://github.com/TuSimple/naive-ui/pull/3410) +- 修复 `n-transfer`中初始值不在选项列表报错 ### Feats