From 3eeb6c2f319b26be378cd44a568b6a6174206abd Mon Sep 17 00:00:00 2001 From: hantianjiao Date: Fri, 27 Sep 2019 14:57:01 +0800 Subject: [PATCH] =?UTF-8?q?link=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89a=E6=A0=87=E7=AD=BE=E7=9A=84target?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/components/CRUD/Table.jsx | 6 ++++++ src/renderers/Link.tsx | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/components/CRUD/Table.jsx b/examples/components/CRUD/Table.jsx index 95149349b..79d00da0f 100644 --- a/examples/components/CRUD/Table.jsx +++ b/examples/components/CRUD/Table.jsx @@ -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' diff --git a/src/renderers/Link.tsx b/src/renderers/Link.tsx index cdb605565..b3e305244 100644 --- a/src/renderers/Link.tsx +++ b/src/renderers/Link.tsx @@ -16,13 +16,13 @@ export class LinkField extends React.Component { }; 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 ( - + {body ? render('body', body) : finnalHref || value || '链接'} );