mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 08:36:19 +08:00
fix(descriotion): fix type #228
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { DescOptions, DescInstance, DescItem } from './types';
|
||||
|
||||
import { defineComponent, computed, ref, unref, CSSProperties } from 'vue';
|
||||
import { get } from 'lodash-es';
|
||||
import { Descriptions } from 'ant-design-vue';
|
||||
import { DescriptionsProps } from 'ant-design-vue/es/descriptions/index';
|
||||
import { CollapseContainer, CollapseContainerOptions } from '/@/components/Container/index';
|
||||
@@ -91,8 +92,11 @@ export default defineComponent({
|
||||
return null;
|
||||
}
|
||||
|
||||
const getContent = () =>
|
||||
isFunction(render) ? render(data?.[field], data) : unref(data) && unref(data)[field];
|
||||
const getContent = () => {
|
||||
const _data = unref(data);
|
||||
const getField = get(_data, field);
|
||||
return isFunction(render) ? render(getField, _data) : getField ?? '';
|
||||
};
|
||||
|
||||
const width = contentMinWidth;
|
||||
return (
|
||||
|
@@ -17,7 +17,7 @@ export interface DescItem {
|
||||
// render
|
||||
render?: (
|
||||
val: string,
|
||||
data: Recordable
|
||||
data: Record<string, any>
|
||||
) => VNode | undefined | JSX.Element | Element | string | number;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user