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
This commit is contained in:
parent
c81d48e734
commit
23eba27456
|
|
@ -83,10 +83,9 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderItem() {
|
function renderItem() {
|
||||||
const { schema } = unref(getProps);
|
const { schema, data } = unref(getProps);
|
||||||
return unref(schema).map((item) => {
|
return unref(schema).map((item) => {
|
||||||
const { render, field, span, show, contentMinWidth } = item;
|
const { render, field, span, show, contentMinWidth } = item;
|
||||||
const { data } = unref(getProps) as DescOptions;
|
|
||||||
|
|
||||||
if (show && isFunction(show) && !show(data)) {
|
if (show && isFunction(show) && !show(data)) {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -112,7 +111,8 @@ export default defineComponent({
|
||||||
}}
|
}}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
);
|
);
|
||||||
});
|
})
|
||||||
|
.filter((item) => !!item);
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderDesc = () => {
|
const renderDesc = () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue