<template>
  <el-form ref="form" :model="value || model" class="eagle-form" v-bind="$attrs" v-on="$listeners">
    <slot v-if="$slots.row" name="row"></slot>
    <el-row v-else v-bind="row">
      <slot></slot>
    </el-row>
  </el-form>
</template>

<script>
import MIX_FORM from '../mixins/form';

export default {
  name: 'Form',
  mixins: [MIX_FORM],
  props: {
    value: Object,
    model: Object,
    row: {
      type: Object,
      default() {
        return {};
      },
    },
    span: [Number, String],
    itemComponent: String,
  },
  provide() {
    return {
      zForm: this,
    };
  },
};
</script>
