update 搜索地址优化
This commit is contained in:
@@ -31,12 +31,23 @@ function renderTitle(title) {
|
||||
function renderItem(title, menu) {
|
||||
return {
|
||||
value: title,
|
||||
openType: menu.openType,
|
||||
component: menu.component,
|
||||
link: menu.link,
|
||||
redirect: menu.redirect,
|
||||
menu,
|
||||
label: (
|
||||
<>
|
||||
{title}
|
||||
<div className="text-normal">{menu.component}</div>
|
||||
<div className="text-normal">
|
||||
{
|
||||
{
|
||||
1: menu.component,
|
||||
2: menu.link,
|
||||
3: menu.redirect,
|
||||
}[menu.openType]
|
||||
}
|
||||
</div>
|
||||
</>
|
||||
),
|
||||
}
|
||||
@@ -73,7 +84,15 @@ export default class search extends Component {
|
||||
searchValue = searchValue.toLowerCase()
|
||||
return (
|
||||
(option.value && option.value.toLowerCase().includes(searchValue)) ||
|
||||
(option.component && option.component.toLowerCase().includes(searchValue))
|
||||
(option.openType === 1 &&
|
||||
option.component &&
|
||||
option.component.toLowerCase().includes(searchValue)) ||
|
||||
(option.openType === 2 &&
|
||||
option.link &&
|
||||
option.link.toLowerCase().includes(searchValue)) ||
|
||||
(option.openType === 3 &&
|
||||
option.redirect &&
|
||||
option.redirect.toLowerCase().includes(searchValue))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user