forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
778 B
37 lines
778 B
/** |
|
* 超链接 |
|
* |
|
* Created by GUY on 2015/9/9. |
|
* @class BI.A |
|
* @extends BI.Text |
|
* @abstract |
|
*/ |
|
import { shortcut, extend, createWidget } from "../../../core"; |
|
import { Text } from "../1.text"; |
|
@shortcut() |
|
export class A extends Text { |
|
static xtype = "bi.a"; |
|
|
|
_defaultConfig() { |
|
const conf = super._defaultConfig(arguments); |
|
|
|
return extend(conf, { |
|
baseCls: `${conf.baseCls || ""} bi-a display-block`, |
|
href: "", |
|
target: "_blank", |
|
el: null, |
|
tagName: "a", |
|
}); |
|
} |
|
|
|
render() { |
|
const { href, target, el } = this.options; |
|
super.render(); |
|
this.element.attr({ href, target }); |
|
if (el) { |
|
createWidget(el, { |
|
element: this, |
|
}); |
|
} |
|
} |
|
}
|
|
|