import { ItemColumns } from "./interface";

// 设置表头
export const useSetColumns = (colums: ItemColumns[]) => {
    return colums.map(el => {
        if (!el.dataIndex) {
            el.dataIndex = el.key
        }
        if (!el.align) {
            el.align = 'center'
        }
        if (!el.width) {
            el.width = 120
        }

        if (!el.slots) {
            el.slots = {
                customRender: el.key,
            }
        }
        return el
    })
}