上述答案不合要求,再给一份
时间: 2024-03-09 08:48:23 浏览: 24
非常抱歉,我的答案未能完全满足您的要求。在此,我给您提供另一份代码,希望能够满足您的需求。
```html
<template>
<div class="phone-input">
<el-input
v-model="phone"
placeholder="请输入手机号码"
prefix-icon=""
class="phone-input__input"
>
<template slot="prepend">
<div class="phone-input__prefix">86</div>
</template>
</el-input>
</div>
</template>
<style scoped>
.phone-input {
.phone-input__input {
border: none;
border-bottom: 1px solid #c0c4cc;
border-radius: 0;
background-color: #ffffff;
}
.phone-input__prefix {
display: flex;
align-items: center;
justify-content: center;
width: 50px;
height: 36px;
background-color: #ffffff;
border: 1px solid #c0c4cc;
border-right: none;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
font-size: 14px;
color: #606266;
}
.el-input-group__append {
height: 36px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border: 1px solid #c0c4cc;
border-left: none;
background-color: #ffffff;
}
}
</style>
```
这份代码在之前的基础上增加了一个`.el-input-group__append`样式,用于控制输入框右侧的背景色与输入框相同,并且与输入框之间只有一根较短的细线相隔的效果。同时,为了让`.el-input-group__append`与`.phone-input__prefix`之间的线条更加清晰,我在它们的样式中均设置了`border`属性。希望这份代码能够满足您的要求。
相关推荐
![](https://img-home.csdnimg.cn/images/20210720083646.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)