<ConfigProvider :transformCellText="customCellStyleRender"><component :is="TableRender" /></ConfigProvider>
component是动态加载的使用TSX写的Table组件
const tableProps = useAttrs();const { bodyCell, ...otherSlots } = defineSlots();/*** 表格渲染*/
const TableRender = computed(() => {return (<Tablestickycolumns={_columns.value}dataSource={dataSource.value}pagination={false}{...tableProps}scroll={{ x: 'max-content' }}>{{...otherSlots,bodyCell: bodyCell ?? _bodyCell,}}</Table>);
});const customCellStyleRender = ({text,record,index,column,
}: {text: string;record: any;index: number;column: any;
}) => {if (column.valueEnum) {return (column.customRender = () => {const val =column.valueEnum?.[text as keyof typeof column.valueEnum]?.text;const status =column.valueEnum?.[text as keyof typeof column.valueEnum]?.status;return <Tag color={status}>{text}</Tag >})();} else return text;
};