<template>
  <el-form :model="model" label-width="100px" ref="form" :rules="rules" status-icon v-validate="rules">
    <slot></slot>
  </el-form>
</template>

<script>

export default {
    props: {
        model: {
            type: Object
        },
        labelWidth: {
            type: String,
            default: '100px'
        }
    },
    data () {
        return {
            rules: {}
        };
    },
    created () {
    },
    methods: {
        validate() {
            this.$refs.form.validate((valid) => {
                if (valid) return true;
                else return false;
            });
        },
        resetFields() {
            this.$refs.form.resetFields();
        }
    }
};
</script>
