Skip to content

Commit

Permalink
fix(description): not rendering while show method return false (#253)
Browse files Browse the repository at this point in the history
* fix(description): not rendering while show method return false

fix #252

* Move data desctruction outside loop
  • Loading branch information
John Niang committed Feb 7, 2021
1 parent c81d48e commit 23eba27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Description/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -112,7 +111,8 @@ export default defineComponent({
}}
</Descriptions.Item>
);
});
})
.filter((item) => !!item);
}

const renderDesc = () => {
Expand Down

0 comments on commit 23eba27

Please sign in to comment.