import { buildProps } from 'element-plus/es/utils/vue/props/runtime' import type { ExtractPropTypes, PropType } from 'vue' import type StandardTable from './standard-table.vue' import type { columnProps, pageDataProps, tableDataProps } from '../../types' export const StandardTableProps = buildProps({ selection: Boolean, // 是否支持多选 index: Boolean, // 是否展示索引 indexMethod: { // 生成索引的方法 type: Function, default(index) { return index+1 } }, columns: { type: Array as PropType, }, list: Array, pagination: { type: Boolean, default: true, }, // 是否有分页 pageData: { type: Object as PropType, }, align: { type: String, default: "left", }, border: String, loading: Boolean, rowKey:[String, Function], defaultExpandAll: Boolean, defaultSort:{ type:Object, default:{} }, showSortDesc:{ type:Boolean, default:true }, //表头新增排序提示 sortDesc:{ type:Object, default:{ 'ascending':'点击降序', 'descending':'点击默认排序', 'default':'点击生序' } }, headerPosition: { type: String }, bodyPosition: { type: String } }) export type StandardTableProps = ExtractPropTypes export type StandardTableInstance = InstanceType