<template>
    <el-table-column v-if="type" :type="type" :selectable="selectable" :label="label"/>
    <el-table-column v-else :label="label" :prop="prop" :min-width="minWidth">
        <template #default="{row}">
            <slot :row="row">{{row[prop]}}</slot>
        </template>
    </el-table-column>
</template>

<script>
export default {
    name: 'Column',
    props: {
        type: {
            type: String,
            default: ''
        },
        selectable: {
            type: Function
        },
        label: {
            type: String,
            default: ''
        },
        prop: {
            type: String
        },
        minWidth: {
            type: Number,
            default: 150
        }
    }
}
</script>