update demo (#16127)

This commit is contained in:
zombieJ 2019-04-16 23:11:12 +08:00 committed by GitHub
parent 343b036957
commit 8f2c74c39f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,16 +41,20 @@ function searchResult(query) {
function renderOption(item) {
return (
<Option key={item.category} text={item.category}>
{item.query} 在
<a
href={`https://s.taobao.com/search?q=${item.query}`}
target="_blank"
rel="noopener noreferrer"
>
{item.category}
</a>
区块中
<span className="global-search-item-count">约 {item.count} 个结果</span>
<div className="global-search-item">
<span className="global-search-item-desc">
{item.query} 在
<a
href={`https://s.taobao.com/search?q=${item.query}`}
target="_blank"
rel="noopener noreferrer"
>
{item.category}
</a>
区块中
</span>
<span className="global-search-item-count">约 {item.count} 个结果</span>
</div>
</Option>
);
}
@ -122,8 +126,17 @@ ReactDOM.render(<Complete />, mountNode);
border-bottom-left-radius: 0;
}
.global-search-item {
display: flex;
}
.global-search-item-desc {
flex: auto;
text-overflow: ellipsis;
overflow: hidden;
}
.global-search-item-count {
position: absolute;
right: 16px;
flex: none;
}
````