From 0a919d707655e4549d4137ba369ffd460b5412e3 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sun, 13 Dec 2020 12:32:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DgetAttribute=E7=9A=84?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/plugins/Tips/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/renderer/plugins/Tips/index.js b/src/renderer/plugins/Tips/index.js index 4e2aee98..eede83c9 100644 --- a/src/renderer/plugins/Tips/index.js +++ b/src/renderer/plugins/Tips/index.js @@ -4,11 +4,14 @@ import { debounce } from '../../utils' let instance let prevTips -const getTips = el => el.getAttribute('tips') - ? el.getAttribute('tips') - : el.parentNode === document.documentElement - ? null - : getTips(el.parentNode) +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)