From 23eba274560a294f50e4b7c529ae8a63a266fb87 Mon Sep 17 00:00:00 2001 From: John Niang Date: Sun, 7 Feb 2021 17:56:58 +0800 Subject: [PATCH] fix(description): not rendering while show method return false (#253) * fix(description): not rendering while show method return false fix #252 * Move data desctruction outside loop --- src/components/Description/src/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Description/src/index.tsx b/src/components/Description/src/index.tsx index fb8ca0d02c0..ab03437fe26 100644 --- a/src/components/Description/src/index.tsx +++ b/src/components/Description/src/index.tsx @@ -83,10 +83,9 @@ export default defineComponent({ } function renderItem() { - const { schema } = unref(getProps); + const { schema, data } = unref(getProps); return unref(schema).map((item) => { const { render, field, span, show, contentMinWidth } = item; - const { data } = unref(getProps) as DescOptions; if (show && isFunction(show) && !show(data)) { return null; @@ -112,7 +111,8 @@ export default defineComponent({ }} ); - }); + }) + .filter((item) => !!item); } const renderDesc = () => {