<script>
export default {
  name: 'RenderCol',
  props: {
    col: {
      type: Function,
      required: true
    },
    param: {
      type: Object,
      default: () => ({})
    }
  },
  render(h) {
    try {
      const content = this.col(h, this.param)
      return <div class="text-center">{content}</div>
    } catch (e) {
      // 渲染失败时提供一个容错显示
      return <div class="text-center">-</div>
    }
  }
}
</script>
