import '../utils/TableOption.space'; import {AutoModule} from "../utils/AutoModule"; declare module '../utils/TableOption.space' { namespace TableOptionSpace { interface iTableOption { render: ReturnType; } } } export const useTableOptionRender = AutoModule.createRegistration(({ state, config }) => { const render = { default: () => { if (state.getAutoTable()?.slots.default.isExist()) { return state.getAutoTable()!.slots.default(); } if (config.render) { if (typeof config.render === "function") { return config.render(); } else { const { render } = config; if (!!render.default) { return render.default(); } } } return null; }, }; return render; });