update 搜索地址优化
This commit is contained in:
@@ -31,12 +31,23 @@ function renderTitle(title) {
|
|||||||
function renderItem(title, menu) {
|
function renderItem(title, menu) {
|
||||||
return {
|
return {
|
||||||
value: title,
|
value: title,
|
||||||
|
openType: menu.openType,
|
||||||
component: menu.component,
|
component: menu.component,
|
||||||
|
link: menu.link,
|
||||||
|
redirect: menu.redirect,
|
||||||
menu,
|
menu,
|
||||||
label: (
|
label: (
|
||||||
<>
|
<>
|
||||||
{title}
|
{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()
|
searchValue = searchValue.toLowerCase()
|
||||||
return (
|
return (
|
||||||
(option.value && option.value.toLowerCase().includes(searchValue)) ||
|
(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