[youzan/vant-weapp]Search 搜索组件

2024-07-04 679 views
1

注意:请按照下面的模板来新建 issue,不规范的 issue 会被立即关闭.

描述一下问题 search搜索框的外部样式问题, custom-class field-class 这两个外部样式设置背景色时有问题。不起作用。 截图 image

环境

  • 设备:
  • 基础库版本: 2.4.1
  • Vant Weapp 版本:0.4.9

`

+

------.wxss--------- .custom { background: red; border: 1px solid red; }

.field { background-color: blue; } .input-search { / border: 1px solid red; / background-color: red; / background: #f4f4f4 !important; / } `

回答

9

image

6

custom-class设置背景色时需要!important,因为本身已经设置了background-color了。

2

field-class呢?如果同时更改custom-class 和 field-class 。 custom加 important是起作用的。但是field不起作用。 另外,希望官方文档明确指明一下,需要加上important。