<script>
// 自定义内容的组件 实现element 自带render函数
const RenderSlot = {
  functional: true,
  props: {
    row: Object,
    render: Function,
    index: Number,
    column: {
      type: Object,
      default: null
    }
  },
  render: (h, data) => {
    const params = {
      index: data.props.index
    }
    if (data.props.column) params.column = data.props.column
    return data.props.render(h, params)
  }
}
export default {
  name: 'headerSlot',
  props: ['item', 'scope'],
  components: { RenderSlot },
  render() {
    let { item, scope } = this
    return <render-slot render={item.headRender} index={scope.$index} column={item} />
  }
}
</script>
