mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [tree] add optional chains to ensure el$ exists (#23137)
* fix(components): [tree] When a hot update occurs, the element does not exist. * refactor: simplify --------- Co-authored-by: Dsaquel <291874700n@gmail.com>
This commit is contained in:
@@ -19,10 +19,7 @@ export function useKeydown({ el$ }: UseKeydownOption, store: Ref<TreeStore>) {
|
||||
})
|
||||
|
||||
onUpdated(() => {
|
||||
const checkboxItems = Array.from(
|
||||
el$.value!.querySelectorAll('input[type=checkbox]')
|
||||
)
|
||||
checkboxItems.forEach((checkbox) => {
|
||||
el$.value?.querySelectorAll('input[type=checkbox]').forEach((checkbox) => {
|
||||
checkbox.setAttribute('tabindex', '-1')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user