下拉搜索报错处理

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) { function handleFilterOption(input, option) {
// label // update-begin--author:liaozhiyang---date:20230914---forQQYUN-6514 Y
let labelIf = option.children()[0]?.children.toLowerCase().indexOf(input.toLowerCase()) >= 0; if (typeof option.children === 'function') {
if (labelIf) { // label
return true; 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 // value
return (option.value || '').toString().toLowerCase().indexOf(input.toLowerCase()) >= 0; return (option.value || '').toString().toLowerCase().indexOf(input.toLowerCase()) >= 0;
} }