1.index.vue 页面:
<template>
<BasicTable @register="register">
</BasicTable>
</template>
2.注册表格部分:
const [register, {
reload }] = useTable({
api: getList, // api接口,返回的数据时数组能正确渲染成功
columns, // 数据源,表格头和数据
rowSelection: {
type: 'radio' }, // 单选
bordered: true, // 边框
useSearchForm: true, // 启用搜索框
showTableSetting: true,
formConfig: {
labelWidth: 120, // 搜索区域宽度
schemas: searchFormSchema, // 搜索的表单项数据源
},
});
3.data里的cloums 和 searchFormSchema部分
export const searchFormSchema: FormSchema[] = [
{
field: 'name',
label: t('routes.module.enterprise.relation.name'),
component: 'Input',
colProps: {
span: 12 },
}
];
export const columns: BasicColumn[] = [
{
title: t