feat:【框架】description 增加对 xx.yyy 属性的读取支持
This commit is contained in:
@@ -7,6 +7,8 @@ import type { DescriptionItemSchema, DescriptionsOptions } from './typing';
|
|||||||
|
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
|
import { get } from '@vben/utils';
|
||||||
|
|
||||||
import { Descriptions, DescriptionsItem } from 'ant-design-vue';
|
import { Descriptions, DescriptionsItem } from 'ant-design-vue';
|
||||||
|
|
||||||
/** 对 Descriptions 进行二次封装 */
|
/** 对 Descriptions 进行二次封装 */
|
||||||
@@ -45,7 +47,7 @@ const Description = defineComponent({
|
|||||||
? item.content(props.data)
|
? item.content(props.data)
|
||||||
: item.content;
|
: item.content;
|
||||||
}
|
}
|
||||||
return item.field ? props.data?.[item.field] : null;
|
return item.field ? get(props.data, item.field) : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import type { DescriptionItemSchema, DescriptionsOptions } from './typing';
|
|||||||
|
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
|
import { get } from '@vben/utils';
|
||||||
|
|
||||||
import { ElDescriptions, ElDescriptionsItem } from 'element-plus';
|
import { ElDescriptions, ElDescriptionsItem } from 'element-plus';
|
||||||
|
|
||||||
/** 对 Descriptions 进行二次封装 */
|
/** 对 Descriptions 进行二次封装 */
|
||||||
@@ -45,7 +47,7 @@ const Description = defineComponent({
|
|||||||
? item.content(props.data)
|
? item.content(props.data)
|
||||||
: item.content;
|
: item.content;
|
||||||
}
|
}
|
||||||
return item.field ? props.data?.[item.field] : null;
|
return item.field ? get(props.data, item.field) : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
|
|||||||
Reference in New Issue
Block a user