<el-form-item prop="focusAreas" :rules="[{ required: true, message: '请输入服务', trigger: 'blur' }]">
<editor :key="handleStatus" v-model="formData.focusAreas" :min-height="192" @blur="changEditor('focusAreas')" />
</el-form-item>
这里需要给富文本框blur事件,因为富文本框清楚后 默认有p标签,所以校验会失效,这里要是触发就把他的值设为null就好了
changEditor(name) {
if (this.formData[name] == '<p><br></p>') {
this.formData[name] = null
}
this.$refs.form.validateField(name)
},