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