|
|
|
@ -6,29 +6,36 @@
|
|
|
|
|
* @extends BI.Text |
|
|
|
|
* @abstract |
|
|
|
|
*/ |
|
|
|
|
BI.A = BI.inherit(BI.Text, { |
|
|
|
|
_defaultConfig: function () { |
|
|
|
|
var conf = BI.A.superclass._defaultConfig.apply(this, arguments); |
|
|
|
|
import { shortcut } from "../../../core/decorator"; |
|
|
|
|
@shortcut() |
|
|
|
|
export class A extends BI.Text { |
|
|
|
|
static xtype = "bi.a"; |
|
|
|
|
constructor() { |
|
|
|
|
super(); |
|
|
|
|
} |
|
|
|
|
// TODO:这里如何修改有问题
|
|
|
|
|
_defaultConfig() { |
|
|
|
|
var conf = super._defaultConfig(arguments); |
|
|
|
|
return BI.extend(conf, { |
|
|
|
|
baseCls: (conf.baseCls || "") + " bi-a display-block", |
|
|
|
|
href: "", |
|
|
|
|
target: "_blank", |
|
|
|
|
el: null, |
|
|
|
|
tagName: "a", |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return BI.extend(conf, { |
|
|
|
|
baseCls: (conf.baseCls || "") + " bi-a display-block", |
|
|
|
|
href: "", |
|
|
|
|
target: "_blank", |
|
|
|
|
el: null, |
|
|
|
|
tagName: "a", |
|
|
|
|
render() { |
|
|
|
|
var o = this.options; |
|
|
|
|
super.render(); |
|
|
|
|
this.element.attr({ href: o.href, target: o.target }); |
|
|
|
|
if (o.el) { |
|
|
|
|
BI.createWidget(o.el, { |
|
|
|
|
element: this, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
var o = this.options; |
|
|
|
|
BI.A.superclass.render.apply(this, arguments); |
|
|
|
|
this.element.attr({ href: o.href, target: o.target }); |
|
|
|
|
if (o.el) { |
|
|
|
|
BI.createWidget(o.el, { |
|
|
|
|
element: this, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BI.shortcut("bi.a", BI.A); |
|
|
|
|
BI.extend(BI, { A }); |
|
|
|
|