<script lang="ts" setup>
defineProps({
  data: {type: Array, default: []},
  columns: {type: Array, default: []},
})

const emit = defineEmits(['click'])

function handleClick(row) {
  emit('row-click', row)
}
</script>

<template>
  <el-table :data="data" height="100%" stripe @row-click="handleClick" style="font-size: 16px">
    <el-table-column v-for="column in columns" :key="column.prop" :label="column.label" :prop="column.prop"
                     :width="column.width" align="center">
      <template v-if="!column.convertFn" #default="scope">
        {{ scope.row[column.prop] }}
      </template>
      <template v-else #default="scope">
        <span v-html="column.convertFn(scope.row[column.prop], scope.$index)"></span>
      </template>
    </el-table-column>
  </el-table>
</template>

<style lang="scss" scoped>
.custom-table .cell {
  font-size: 16px; /* 你想要的字体大小 */
}
</style>
