:controls="false",不使用控制按钮;
html
<div>
<span class="label">金额</span>
<div
style="width: 100%;border: solid 1px rgba(0, 0, 0, 0.1); border-radius: 4px; display: flex;align-items: center;"
>
<el-input-number
v-model.trim="queryParams.amount"
placeholder="请输入交易金额"
:controls="false"
size="small"
@keyup.enter.native="handleQuery"
/>
<i
class="el-icon-circle-close"
style="margin: 5px;color: rgba(0, 0, 0, 0.3);"
@click="clearInputNumber('amount')"
></i>
</div>
</div>
清空方法:
javascript
clearInputNumber (property) {
// console.log("🚀 ~ clearInputNumber ~ property:", property)
this.queryParams[property] = undefined
},
css样式:
css
<style lang="scss" scoped>
::v-deep .el-input-number.is-without-controls .el-input__inner{
text-align: left !important; // 左对齐
border: none;
}
</style>