diff --git a/components/tabs/doc/index.en-US.md b/components/tabs/doc/index.en-US.md index 32eb29e559a..52200810746 100644 --- a/components/tabs/doc/index.en-US.md +++ b/components/tabs/doc/index.en-US.md @@ -39,7 +39,8 @@ import { NzTabsModule } from 'ng-zorro-antd/tabs'; | `[nzTabBarGutter]` | The gap between tabs | `number` | - | | `[nzHideAll]` | Whether hide all tabs | `boolean` | `false` | | `[nzShowPagination]` | Whether show pre or next button when exceed display area | `boolean` | `true` | -| `[nzLinkRouter]` | Link with Angular router. It supports child mode and query param mode | `boolean` | `false` || +| `[nzLinkRouter]` | Link with Angular router. It supports child mode and query param mode | `boolean` | `false` | +| `[nzLinkExact]` | Use exact routing matching | `boolean` | `true` | | `(nzSelectedIndexChange)` | Current tab's index change callback | `EventEmitter` | - | | `(nzSelectChange)` | Current tab's change callback | `EventEmitter<{nzSelectedIndex: number,tab: NzTabComponent}>` | - | | `(nzOnNextClick)` | Callback executed when next button is clicked | `EventEmitter` | - | diff --git a/components/tabs/doc/index.zh-CN.md b/components/tabs/doc/index.zh-CN.md index 0699052545c..d5e4283f09e 100644 --- a/components/tabs/doc/index.zh-CN.md +++ b/components/tabs/doc/index.zh-CN.md @@ -42,7 +42,8 @@ import { NzTabsModule } from 'ng-zorro-antd/tabs'; | `[nzTabBarGutter]` | tabs 之间的间隙 | `number` | - | | `[nzHideAll]` | 是否隐藏所有tab内容 | `boolean` | `false` | | `[nzShowPagination]` | 是否超出范围时显示pre和next按钮 | `boolean` | `true` | -| `[nzLinkRouter]` | 与 Angular 路由联动 | `boolean` | `false` || +| `[nzLinkRouter]` | 与 Angular 路由联动 | `boolean` | `false` | +| `[nzLinkExact]` | 以严格匹配模式确定联动的路由 | `boolean` | `true` | | `(nzSelectedIndexChange)` | 当前激活 tab 面板的 序列号变更回调函数 | `EventEmitter` | - | | `(nzSelectChange)` | 当前激活 tab 面板变更回调函数 | `EventEmitter<{nzSelectedIndex: number,tab: NzTabComponent}>` | - | | `(nzOnNextClick)` | next 按钮被点击的回调 | `EventEmitter` | - | diff --git a/components/tabs/nz-tabset.component.ts b/components/tabs/nz-tabset.component.ts index 59b686f7b43..a845346dffa 100644 --- a/components/tabs/nz-tabset.component.ts +++ b/components/tabs/nz-tabset.component.ts @@ -86,6 +86,7 @@ export class NzTabSetComponent @ContentChildren(NzTabComponent) listOfNzTabComponent: QueryList; @ViewChild(NzTabsNavComponent, { static: false }) nzTabsNavComponent: NzTabsNavComponent; @ViewChild('tabContent', { static: false }) tabContent: ElementRef; + @Input() nzTabBarExtraContent: TemplateRef; @Input() nzShowPagination = true; @Input() nzAnimated: NzAnimatedInterface | boolean = true; @@ -97,7 +98,7 @@ export class NzTabSetComponent @Input() nzType: NzTabType = 'line'; @Input() @InputBoolean() nzLinkRouter = false; - @Input() nzQueryParam: string; + @Input() @InputBoolean() nzLinkExact = true; @Output() readonly nzOnNextClick = new EventEmitter(); @Output() readonly nzOnPrevClick = new EventEmitter(); @@ -340,6 +341,6 @@ export class NzTabSetComponent } private isLinkActive(router: Router): (link?: RouterLink | RouterLinkWithHref) => boolean { - return (link?: RouterLink | RouterLinkWithHref) => (link ? router.isActive(link.urlTree, true) : false); + return (link?: RouterLink | RouterLinkWithHref) => (link ? router.isActive(link.urlTree, this.nzLinkExact) : false); } }