<template>
  <el-table-column :type="type" :selectable="selectable" :label="label" :prop="prop" :min-width="minWidth" :formatter="dateFormatter" />
</template>

<script>

export default {
    name: 'DateColumn',
    props: {
        type: {
            type: String,
            default: ''
        },
        selectable: {
            type: Function
        },
        label: {
            type: String,
            default: ''
        },
        prop: {
            type: String
        },
        minWidth: {
            type: Number,
            default: 150
        }
    },
  methods: {
      dateFormatter(row,column,cellValue){
          if (!cellValue) {
              return ''
          }
          return cellValue.split(' ')[0]
      }
  }
}
</script>