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) }) }, /*读写删除元素节点的样式*/