优化提示查找逻辑

This commit is contained in:
lyswhut
2020-09-29 14:41:41 +08:00
parent 1b561bbf4c
commit 3a630edaa5
2 changed files with 7 additions and 24 deletions
+5 -7
View File
@@ -4,13 +4,11 @@ import { debounce } from '../../utils'
let instance
let prevTips
const getTips = el => el == null
? null
: el.getAttribute('tips')
? el.getAttribute('tips')
: el.parentNode === document.body
? null
: getTips(el.parentNode)
const getTips = el => el.getAttribute('tips')
? el.getAttribute('tips')
: el.parentNode === document.documentElement
? null
: getTips(el.parentNode)
const showTips = debounce(event => {
let msg = getTips(event.target)