mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 04:18:29 +08:00
commit
5856515bda
@ -124,6 +124,12 @@ export default {
|
||||
type: 'tpl',
|
||||
tpl: '定制内容示例:当前有 ${count} 条数据。',
|
||||
className: 'v-middle'
|
||||
}, {
|
||||
type: 'link',
|
||||
href: 'https://www.baidu.com',
|
||||
body: '百度一下',
|
||||
htmlTarget: '_parent',
|
||||
className: 'v-middle'
|
||||
}, {
|
||||
type: 'columns-toggler',
|
||||
align: 'right'
|
||||
|
@ -16,13 +16,13 @@ export class LinkField extends React.Component<LinkProps, object> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const {className, body, href, classnames: cx, blank, data, render} = this.props;
|
||||
const {className, body, href, classnames: cx, blank, htmlTarget, data, render} = this.props;
|
||||
|
||||
let value = this.props.value;
|
||||
const finnalHref = href ? filter(href, data) : '';
|
||||
|
||||
return (
|
||||
<a href={finnalHref || value} target={blank ? '_blank' : '_self'} className={cx('Link', className)}>
|
||||
<a href={finnalHref || value} target={htmlTarget || (blank ? '_blank' : '_self')} className={cx('Link', className)}>
|
||||
{body ? render('body', body) : finnalHref || value || '链接'}
|
||||
</a>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user