|
@@ -1,4 +1,4 @@
|
|
|
-import { ElDescriptions, ElDescriptionsItem } from "element-plus";
|
|
|
+import { ElDescriptions, ElDescriptionsItem, ElEmpty } from "element-plus";
|
|
|
import { defineComponent } from "vue";
|
|
|
import { basicDescriptionsProps } from "./types";
|
|
|
|
|
@@ -7,9 +7,9 @@ const BasicDescriptions = defineComponent({
|
|
|
props: basicDescriptionsProps,
|
|
|
setup(props, { slots }) {
|
|
|
return () => {
|
|
|
- const { title, colNumber, columns, data, labelWidth } = props;
|
|
|
+ const { title, colNumber, columns, data, labelWidth, show } = props;
|
|
|
|
|
|
- return (
|
|
|
+ return show ? (
|
|
|
<ElDescriptions title={title} border column={colNumber} size="small">
|
|
|
{columns.map(col => (
|
|
|
<ElDescriptionsItem
|
|
@@ -24,6 +24,8 @@ const BasicDescriptions = defineComponent({
|
|
|
|
|
|
{slots.custom && slots.custom(props.data)}
|
|
|
</ElDescriptions>
|
|
|
+ ) : (
|
|
|
+ <ElEmpty description="暂无数据"></ElEmpty>
|
|
|
);
|
|
|
};
|
|
|
}
|