From 48d60340ee94cd5278416dd2ab9f134cd73a393b Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 17 Dec 2021 16:06:23 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20=E7=BB=91=E5=AE=9A=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=9C=B0=E6=96=B9=E5=BB=B6=E8=BF=9F=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E4=B8=80=E4=B8=8B=EF=BC=8C=E4=BC=9A=E6=9C=89=E5=A5=BD=E5=A4=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/combo.js | 3 ++- src/base/combination/expander.js | 3 ++- src/base/combination/switcher.js | 3 ++- src/base/single/button/button.basic.js | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 64192fe29..540b693b8 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -43,7 +43,8 @@ render: function () { var self = this, o = this.options; this._initCombo(); - this._initPullDownAction(); + // 延迟绑定事件,这样可以将自己绑定的事情优先执行 + BI.nextTick(this._initPullDownAction.bind(this)); this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { if (self.isEnabled() && self.isValid()) { if (type === BI.Events.EXPAND) { diff --git a/src/base/combination/expander.js b/src/base/combination/expander.js index 866949f28..83b99566a 100644 --- a/src/base/combination/expander.js +++ b/src/base/combination/expander.js @@ -25,7 +25,8 @@ BI.Expander = BI.inherit(BI.Widget, { var self = this, o = this.options; this._expanded = !!o.el.open; this._initExpander(); - this._initPullDownAction(); + // 延迟绑定事件,这样可以将自己绑定的事情优先执行 + BI.nextTick(this._initPullDownAction.bind(this)); this.expander.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { if (self.isEnabled() && self.isValid()) { if (type === BI.Events.EXPAND) { diff --git a/src/base/combination/switcher.js b/src/base/combination/switcher.js index 96a1d3c6a..b464af3d9 100644 --- a/src/base/combination/switcher.js +++ b/src/base/combination/switcher.js @@ -25,7 +25,8 @@ BI.Switcher = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; this._initSwitcher(); - this._initPullDownAction(); + // 延迟绑定事件,这样可以将自己绑定的事情优先执行 + BI.nextTick(this._initPullDownAction.bind(this)); this.switcher.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { if (self.isEnabled() && self.isValid()) { if (type === BI.Events.EXPAND) { diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index 76ffb77ad..d975bdb81 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -31,7 +31,7 @@ BI.BasicButton = BI.inherit(BI.Single, { _init: function () { BI.BasicButton.superclass._init.apply(this, arguments); var opts = this.options; - + if (opts.shadow) { this._createShadow(); } @@ -44,7 +44,8 @@ BI.BasicButton = BI.inherit(BI.Single, { if (this.options.selected === true) { this.setSelected(true); } - this.bindEvent(); + // 延迟绑定事件,这样可以将自己绑定的事情优先执行 + BI.nextTick(this.bindEvent.bind(this)); BI.BasicButton.superclass._initRef.apply(this, arguments); },