<el-select
ref="headerSearchSelect"
v-model="search"
:remote-method="querySearch"
filterable
default-first-option
remote
placeholder="请输入报表关键词"
@change="change"
popper-class="select-con"
clearable
@focus="clear"
@hook:mounted="clear"
@visible-change="clear"
>
<!-- :transfer="true"
:popper-append-to-body="false" -->
<svg-icon class-name="search-icon" slot="prefix" icon-class="search" />
<el-option
v-for="option in options"
:key="option.path + option.label"
:value="option.value"
:label="option.label"
>
<span v-html="option.name"></span>
</el-option>
</el-select>
clear(async) {
this.$nextTick(() => {
if (!async) {
// ios 手机有延迟问题
setTimeout(() => {
const { headerSearchSelect } = this.$refs;
const input =
headerSearchSelect.$el.querySelector('.el-input__inner');
input.removeAttribute('readonly');
}, 200);
}
});
},