From 328a7ca6d580286a08dc3ba065e3118fcf988424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 30 Jul 2021 11:52:50 +0800 Subject: [PATCH] fix --- src/02-core.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/02-core.js b/src/02-core.js index 6a12281..2f5eab8 100644 --- a/src/02-core.js +++ b/src/02-core.js @@ -85,10 +85,7 @@ Anot.PropsTypes.isBoolean = function() { /*判定是否是一个朴素的javascript对象(Object),不是DOM对象,不是BOM对象,不是自定义类的实例*/ Anot.isPlainObject = function(obj) { // 简单的 typeof obj === "object"检测,会致使用isPlainObject(window)在opera下通不过 - return ( - serialize.call(obj) === '[object Object]' && - Object.getPrototypeOf(obj) === oproto - ) + return serialize.call(obj) === '[object Object]' && Object.getPrototypeOf(obj) === oproto } let VMODELS = (Anot.vmodels = {}) //所有vmodel都储存在这里 @@ -168,11 +165,7 @@ Anot.mix = Anot.fn.mix = function() { if (target === copy) { continue } - if ( - deep && - copy && - (Anot.isPlainObject(copy) || (copyIsArray = Array.isArray(copy))) - ) { + if (deep && copy && (Anot.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) { if (copyIsArray) { copyIsArray = false clone = src && Array.isArray(src) ? src : [] @@ -278,7 +271,7 @@ Anot.mix({ t = t.trim() let hook = hooks[t] if (typeof hook === 'object') { - t = hook.type || type + t = hook.type || t phase = hook.phase || !!phase fn = hook.fix ? hook.fix(el, fn) : fn } @@ -295,7 +288,7 @@ Anot.mix({ t = t.trim() let hook = hooks[t] if (typeof hook === 'object') { - t = hook.type || type + t = hook.type || t phase = hook.phase || !!phase } el.removeEventListener(t, fn, phase)