-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(module:tabs): add nzCanDeactivate hook #4476
Conversation
This preview will be available after the checks is complete. |
Deploy preview for ng-zorro-master ready! Built with commit b5ba347 |
@hsuanxyz @vthinkxie @wendzhue 其实我真实的需求挺变态的, 我是需要在子 tab 的 centent ,也就是我的自定义组件 <nz-tabset>
<nz-tab nzTitle="Tab 1">
<my-cmp1></my-cmp1>
</nz-tab>
<nz-tab nzTitle="Tab 2">
<my-cmp2></my-cmp2>
</nz-tab>
<nz-tab nzTitle="Tab 3">
<my-cmp3></my-cmp3>
</nz-tab>
</nz-tabset> |
Codecov Report
@@ Coverage Diff @@
## master #4476 +/- ##
==========================================
+ Coverage 93.23% 93.25% +0.02%
==========================================
Files 519 520 +1
Lines 12822 12835 +13
Branches 2013 2017 +4
==========================================
+ Hits 11954 11969 +15
+ Misses 452 451 -1
+ Partials 416 415 -1
Continue to review full report at Codecov.
|
@danranVm 虽然 router 提供了 |
components/tabs/demo/guard.ts
Outdated
@@ -1,4 +1,5 @@ | |||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | |||
import { NzCanChangeFn } from 'ng-zorro-antd/tabs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 Type 的名称最好再细化一些,或许其他组件将来也会有这样的需求
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wendzhue 对 API 名有什么更好的建议吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hsuanxyz NzTabsCanChangeFn
? 反正组件 specific 就好了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那 Input 名呢,要不和 router 对齐一下?比如 nzCanActivateTabs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那就这样吧 ~ @Input() nzCanDeactivate: NzTabsCanDeactivateFn
* feat(module:tabs): add and hooks * feat(module:tabs): fix bug with onpush * feat(module:tabs): remove canDeactivate and add test * feat(module:tabs): update demo * feat(module:tabs): modify api name * feat(module:tabs): remove console close NG-ZORRO#4432
* feat(module:tabs): add and hooks * feat(module:tabs): fix bug with onpush * feat(module:tabs): remove canDeactivate and add test * feat(module:tabs): update demo * feat(module:tabs): modify api name * feat(module:tabs): remove console close NG-ZORRO#4432
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #4432
What is the new behavior?
Does this PR introduce a breaking change?
Other information