Merge pull request #6310 from ChenguangWang/cg-branch
feat: select 搜索功能情况下问题,只匹配label
This commit is contained in:
commit
640f39343f
1 changed files with 1 additions and 2 deletions
|
@ -490,13 +490,12 @@
|
|||
},
|
||||
|
||||
validateOption({children, elm, propsData}){
|
||||
const value = propsData.value;
|
||||
const label = propsData.label || '';
|
||||
const textContent = (elm && elm.textContent) || (children || []).reduce((str, node) => {
|
||||
const nodeText = node.elm ? node.elm.textContent : node.text;
|
||||
return `${str} ${nodeText}`;
|
||||
}, '') || '';
|
||||
const stringValues = JSON.stringify([value, label, textContent]);
|
||||
const stringValues = JSON.stringify([label, textContent]);
|
||||
const query = this.query.toLowerCase().trim();
|
||||
return stringValues.toLowerCase().includes(query);
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue