From ce9c8542a9b4251bdbcdb831683085784d24073c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 30 Jul 2021 11:57:49 +0800 Subject: [PATCH] fix --- src/02-core.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/02-core.js b/src/02-core.js index 2f5eab8..79ac332 100644 --- a/src/02-core.js +++ b/src/02-core.js @@ -272,10 +272,10 @@ Anot.mix({ let hook = hooks[t] if (typeof hook === 'object') { t = hook.type || t - phase = hook.phase || !!phase + phase = hook.phase || phase fn = hook.fix ? hook.fix(el, fn) : fn } - el.addEventListener(t, fn, phase) + el.addEventListener(t, fn, !!phase) }) return fn }, @@ -289,9 +289,9 @@ Anot.mix({ let hook = hooks[t] if (typeof hook === 'object') { t = hook.type || t - phase = hook.phase || !!phase + phase = hook.phase || phase } - el.removeEventListener(t, fn, phase) + el.removeEventListener(t, fn, !!phase) }) }, /*读写删除元素节点的样式*/