Skip to content

Commit

Permalink
style: 优化 select
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed May 11, 2024
1 parent d3b537e commit 8450bdf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/fighting-design/option/src/option.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@
return false
}
if (parentInject.filter && parentInject.isFiltering) {
return (currentLabel as string).includes(parentInject.inputValue)
// 在过滤属性存在并且是正在输入中,执行过滤操作
if (parentInject.filter && parentInject.isFiltering && currentLabel) {
return currentLabel.toString().includes(parentInject.inputValue)
}
return true
Expand Down Expand Up @@ -152,7 +153,11 @@
* 初始化设置选中的值
*/
const setInit = (): void => {
if (currentValue === parentInject?.modelValue) {
if (!parentInject) {
return
}
if (currentValue === parentInject.modelValue) {
parentInject && run(parentInject.setValue, currentValue, currentLabel)
}
}
Expand Down

0 comments on commit 8450bdf

Please sign in to comment.