修复getAttribute的报错

pull/392/head
lyswhut 2020-12-13 12:32:55 +08:00
parent 684d90d0e7
commit 0a919d7076
1 changed files with 8 additions and 5 deletions

View File

@ -4,11 +4,14 @@ import { debounce } from '../../utils'
let instance
let prevTips
const getTips = el => el.getAttribute('tips')
const getTips = el =>
el
? el.getAttribute('tips')
? el.getAttribute('tips')
: el.parentNode === document.documentElement
? null
: getTips(el.parentNode)
: null
const showTips = debounce(event => {
let msg = getTips(event.target)