iview Form验证自定义组件
this.$parent.$emit("on-form-change");
freeCom.vue
<input type="text" name="" id="" @input="emitfun" v-model="val" />
emitfun() {
this.$parent.$emit("on-form-change");
this.$emit("input", this.val)
}
hello.vue
<Form ref="formValidate" :model="formValidate" :label-width="80">
<FormItem label="Name" prop="name" :rules="validate">
<freeCom @abcdefg="abcccc" v-model="formValidate.name" ></freeCom>
</FormItem>
<FormItem>
<Button type="primary" @click="handleSubmit('formValidate')">Submit</Button>
<Button @click="handleReset('formValidate')" style="margin-left: 8px">Reset</Button>
</FormItem>
</Form>
**************************elementUI*未验证是否可用************************************
this.$parent.$emit("el.form.change");
this.$parent.$emit("el.form.blur");