fix(grid): [grid] fix shadow-root does not have getAttribute function (#1593)

This commit is contained in:
gimmyhehe 2024-04-26 16:03:58 +08:00 committed by GitHub
parent 55e65a4464
commit 0bd0d8b9e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -179,7 +179,10 @@ export const colToVisible = ($table, column, move) => {
}
export const hasDataTag = (el, value) => {
if (!el || !value) return false
// el可能为shadow-rootshadow-root没有getAttribute方法
if (!el || !value || !el.getAttribute) {
return false
}
return (' ' + el.getAttribute('data-tag') + ' ').includes(' ' + value + ' ')
}