import classNames from 'classnames';

export default function () {
  let TableCell = require('ant-design-vue/es/vc-table/src/TableCell.js').default


  TableCell.render = (function (fn) {
    return function (h) {
      const vNode = fn.apply(this, arguments);
      const { record, column, index } = this.$props;

      if (column.hidden) return null
      if (column._vc_class) {
        vNode.data.class=classNames(vNode.data.class,column._vc_class)
      }


      // try {
      //   if (column.hidden) {
      //     vNode.data.style={display: 'none'}
      //   }else if (record && column.tooltip) {
      //     let textVnode = { ...vNode.children[vNode.children.length - 1] }
      //     let text = record[column.key]
      //     let filter = ['sectionDown', 'selection-column', '_row_count']
      //     if (textVnode.text) {
      //       vNode.children[vNode.children.length - 1] = h('a-tooltip', { attrs: { placement: 'bottomLeft', destroyTooltipOnHide: true, title: textVnode.text } }, [textVnode])
      //     } else if (textVnode && !filter.includes(column.key)) {
      //       vNode.children = [h('a-tooltip', { attrs: { mouseEnterDelay: 0.5,title: text, destroyTooltipOnHide: true, placement: 'bottomLeft' } }, vNode.children)]
      //     }
      //   }
      // } catch (e) {
      //   console.error(e)

      // }
      return vNode

    }

  })(TableCell.render)


}