自定义input按钮且readonly和clearable共存
<el-input v-model="form.customer" placeholder="请选择" readonly>
<template #suffix>
<i class="el-icon-close" style="margin-left: 5px;cursor: pointer;" v-show="form.customer" @click="btnClearable"></i>
<el-button @click="changeClick" :disabled="!form.region" style="border: none" type="text">选择客户</el-button>
</template>
</el-input>
methods: {
btnClearable(){
this.form.customer = ''
},
changeClick(){
this.customerDialog = true
},
}
<style lang="scss" scoped>
.el-icon-close:before {
content: "\E78D";
}
</style>
效果图: