- 这是一个搜索框,引入在我的项目里
发现错位了
<div className={styles["global-search-wrapper"]} style={{ width: 300 }}>
<AutoComplete
className={styles["global-search"]}
size="large"
style={{ width: '100%' }}
dataSource={dataSource.map(renderOption)}
onSelect={onSelect}
onSearch={this.handleSearch}
placeholder="input here"
optionLabelProp="text"
>
<Input
suffix={(
<Button className={styles["input-icon"]} size="large" type="primary">
<Icon type="search" />
</Button>
)}
/>
</AutoComplete>
</div>
通过调试发现实际工作的样式是
.ant-input-affix-wrapper .ant-input-suffix {
right: 12px;
}
但是实际上官方的例子中,已经覆盖了
.global-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input-suffix {
right: 0px;
}
为什么下面的优先级没有上面的高呢?
上面的是Input这个组件里带的
F12确认下是样式没应用上,还是优先级问题?