From bb20a9207792f69ee5d7a51b8a0c28e2b6df166e Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 17 Oct 2022 15:20:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JRIA=20=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/3.ob.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/core/3.ob.js b/src/core/3.ob.js index f23ebd67b..100fcac17 100644 --- a/src/core/3.ob.js +++ b/src/core/3.ob.js @@ -32,7 +32,11 @@ this._constructor(config); }; BI._.extend(OB.prototype, { - props: {}, init: null, destroyed: null, + props: {}, + + init: null, + + destroyed: null, _constructor: function (config) { this._initProps(config); @@ -143,7 +147,9 @@ this.un(eventName, proxy); }; this.on(eventName, proxy); - }, /** + }, + + /** * 解除观察者绑定的指定事件 * @param {String} eventName 要解除绑定事件的名字 * @param {Function} fn 事件对应的执行函数,该参数是可选的,没有该参数时,将解除绑定所有同名字的事件 @@ -166,13 +172,17 @@ this._getEvents()[eventName] = newFns; } } - }, /** + }, + + /** * 清除观察者的所有事件绑定 */ purgeListeners: function () { /* alex:清空events*/ this.events = {}; - }, /** + }, + + /** * 触发绑定过的事件 * * @param {String} eventName 要触发的事件的名字