下拉搜索报错处理

pull/755/merge
zhangdaiscott 2023-09-14 18:58:51 +08:00
parent 55d5b77ac3
commit f57b33d2bb
1 changed files with 8 additions and 4 deletions

View File

@ -185,11 +185,15 @@
/** 用于搜索下拉框中的内容 */
function handleFilterOption(input, option) {
// label
let labelIf = option.children()[0]?.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
if (labelIf) {
return true;
// update-begin--author:liaozhiyang---date:20230914---forQQYUN-6514 Y
if (typeof option.children === 'function') {
// label
let labelIf = option.children()[0]?.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
if (labelIf) {
return true;
}
}
// update-end--author:liaozhiyang---date:20230914---forQQYUN-6514 Y
// value
return (option.value || '').toString().toLowerCase().indexOf(input.toLowerCase()) >= 0;
}