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

Loading…
Cancel
Save