fix(router-link): add missing target prop (#18659)

references #18655
This commit is contained in:
Brandy Carney
2019-07-01 11:23:41 -04:00
committed by GitHub
parent 36a58df181
commit 1f51ab27c4
5 changed files with 20 additions and 2 deletions

View File

@ -36,6 +36,13 @@ export class RouterLink implements ComponentInterface {
*/
@Prop() routerDirection: RouterDirection = 'forward';
/**
* Specifies where to display the linked URL.
* Only applies when an `href` is provided.
* Special keywords: `"_blank"`, `"_self"`, `"_parent"`, `"_top"`.
*/
@Prop() target: string | undefined;
private onClick = (ev: Event) => {
openURL(this.href, ev, this.routerDirection);
}
@ -44,7 +51,8 @@ export class RouterLink implements ComponentInterface {
const mode = getIonMode(this);
const attrs = {
href: this.href,
rel: this.rel
rel: this.rel,
target: this.target
};
return (
<Host