guy 3 years ago
parent
commit
7be8309be8
  1. 14
      src/base/single/button/button.basic.js

14
src/base/single/button/button.basic.js

@ -31,12 +31,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
_init: function () {
BI.BasicButton.superclass._init.apply(this, arguments);
var opts = this.options;
if (opts.selected === true) {
BI.nextTick(BI.bind(function () {
this.setSelected(opts.selected);
}, this));
}
BI.nextTick(BI.bind(this.bindEvent, this));
if (opts.shadow) {
this._createShadow();
@ -46,6 +40,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
}
},
_initRef: function () {
if (this.options.selected === true) {
this.setSelected(true);
}
this.bindEvent();
BI.BasicButton.superclass._initRef.apply(this, arguments);
},
// 默认render方法
render: function () {
return this.options.el;

Loading…
Cancel
Save