-
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:collapse): support custom icon #2783
Conversation
Deploy preview for ng-zorro-master ready! Built with commit f7dd9db |
Codecov Report
@@ Coverage Diff @@
## master #2783 +/- ##
==========================================
- Coverage 97.36% 97.36% -0.01%
==========================================
Files 526 526
Lines 11026 11034 +8
Branches 786 786
==========================================
+ Hits 10736 10743 +7
- Misses 189 190 +1
Partials 101 101
Continue to review full report at Codecov.
|
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.
You should make sure that the DOM structure is same with Ant Design. And we can provide more customized API for our users.
@danranVm LGTM. Thanks for your great work! |
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.
Some minor problems. Avoid DOM changes, please.
@wendzhue please review |
@danranVm 问题在于比 React 那边多嵌套了一层 DOM 而不是该用哪个标签. 为了避免将来在样式上出现问题, 我们一般和 ant design 那边在 DOM 结构上不会有大的差异. |
@wendzhue 好吧 如果只用一层 i 的话,可以做到,只不过代码看起来不够简洁,例如 <ng-container *ngIf="nzShowArrow">
<ng-container *ngIf="nzExpandedIcon;else defaultIcon">
<ng-container *nzStringTemplateOutlet="nzExpandedIcon">
<i class="ant-collapse-arrow anticon-right" nz-icon [type]="nzExpandedIcon"></i>
</ng-container>
</ng-container>
<ng-template #defaultIcon>
<i class="ant-collapse-arrow anticon-right" nz-icon type="right" ></i>
</ng-template>
</ng-container> 或者,你还有更好的方法吗?😄 |
|
@wendzhue @vthinkxie 现在应该可以了吧~ 我之前没想到 另外把 |
@danranVm 应该不是. React 那边的 icon 新增了 rotate API, 这个 API 我刚才也添加上了. 而且样式也刚刚同步过一次. 试试使用 rotate API. |
rotate 问题单独修复,感谢pr |
@danranVm 旋转问题我会在另外一个 PR 里解决掉. Thank you! |
* feat(module:collapse): support custom icon * feat(module:collapse): support custom icon * feat(module:collapse): support custom icon * feat(module:collapse): fix test * feat(module:collapse): fix test * feat(module:collapse): change dom and recover style file * feat(module:collapse): use span replace i * feat(module:collapse): support custom icon
* feat(module:collapse): support custom icon * feat(module:collapse): support custom icon * feat(module:collapse): support custom icon * feat(module:collapse): fix test * feat(module:collapse): fix test * feat(module:collapse): change dom and recover style file * feat(module:collapse): use span replace i * feat(module:collapse): support custom icon
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: #2736
What is the new behavior?
Does this PR introduce a breaking change?
Other information