el-input clearable不生效
el-input触发的时候需要触发focus事件会导致clearable的值清空不掉
原先的代码
<el-input
clearable
type="text"
v-model="formData[item.code]"
@focus="propFocus(item, formData[item.code])"/>
重写后
<el-input
v-if="searchType === '0'"
type="text"
v-model="formData[item.code]"
@focus="propFocus(item, formData[item.code])"
>
<i
slot="suffix"
v-show="formData[item.code]"
@click="clearForm(formData, item.code)"
class="el-input__icon el-icon-error err-style"
></i>
</el-input>
clearForm(a, b) {
this.formData[b] = '';
this.$forceUpdate();
},
主要就是重写删除图标
代码搬运工