实现这一点的最快方法是向名为style
(版本4)或sx
(版本5)的自动完成元素添加新的props .以下示例说明了如何执行此操作:
<Autocomplete
(...)
style={{ width: 300 }}
/>
<Autocomplete
(...)
sx={{ width: 300 }}
/>
或百分比值
<Autocomplete
(...)
style={{ width: "100%" }}
/>
<Autocomplete
(...)
sx={{ width: "100%" }}
/>
如果这不起作用,那么请向我们展示什么是适用于类的css规则称为searchContainer
.