最近有个Vue3项目,UI用的UI View Plus。其中Input组件需要将背景色设置为透明。
起因:最近在一个Vue3前端项目中,使用了UI View Plus。使用Input组件时,背景色默认是白色,不好看,影响了用户的体验。我们就想把Input组件的背景设置为透明。
修改后的效果如下,明显就好很多。
如何实现上面的效果呢?
直接上代码:
<Input v-model="phoneNumber" :border="false" placeholder="请输入手机号" class="input_class" />
css部分代码如下:
::v-deep .ivu-input {
background-color: transparent !important;
}
.input_class {
width:75%;
}
:border="false" 表示是不显示线条边框。
具体见红色部分的代码,亲测有效!希望能够帮助你。
全部评论