Browse Source

KERNEL-13846 refactor: 优化代码,采用解构方式引入变量

es6
Joker.Wang-王顺 2 years ago
parent
commit
1222710076
  1. 10
      src/base/single/a/a.js

10
src/base/single/a/a.js

@ -12,7 +12,7 @@ export class A extends BI.Text {
static xtype = "bi.a"; static xtype = "bi.a";
_defaultConfig() { _defaultConfig() {
var conf = super._defaultConfig(arguments); const conf = super._defaultConfig(arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-a display-block", baseCls: (conf.baseCls || "") + " bi-a display-block",
href: "", href: "",
@ -23,11 +23,11 @@ export class A extends BI.Text {
} }
render() { render() {
var o = this.options; const { href, target, el} = this.options;
super.render(); super.render();
this.element.attr({ href: o.href, target: o.target }); this.element.attr({ href, target });
if (o.el) { if (el) {
BI.createWidget(o.el, { BI.createWidget(el, {
element: this, element: this,
}); });
} }

Loading…
Cancel
Save