-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module:collapse): support
nzExtra
(#3177)
* feat(module:collapse): support extra * docs: add extra demo
- Loading branch information
Showing
10 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
order: 5 | ||
title: | ||
zh-CN: 额外节点 | ||
en-US: Extra Node | ||
--- | ||
|
||
## zh-CN | ||
|
||
你可以通过 `nzExtra` 来指定面板右上角的额外内容。 | ||
|
||
## en-US | ||
|
||
You can use `nzExtra` to put extra elements in the top right corner. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-collapse-extra', | ||
template: ` | ||
<nz-collapse> | ||
<nz-collapse-panel | ||
*ngFor="let panel of panels" | ||
[nzHeader]="panel.name" | ||
[nzActive]="panel.active" | ||
[nzExtra]="extraTpl" | ||
[nzDisabled]="panel.disabled" | ||
> | ||
<p style="margin:0;"> | ||
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome | ||
guest in many households across the world. | ||
</p> | ||
</nz-collapse-panel> | ||
</nz-collapse> | ||
<ng-template #extraTpl> | ||
<i nz-icon nzType="setting"></i> | ||
</ng-template> | ||
`, | ||
styles: [] | ||
}) | ||
export class NzDemoCollapseExtraComponent { | ||
panels = [ | ||
{ | ||
active: true, | ||
name: 'This is panel header 1', | ||
disabled: false | ||
}, | ||
{ | ||
active: false, | ||
disabled: false, | ||
name: 'This is panel header 2' | ||
}, | ||
{ | ||
active: false, | ||
disabled: true, | ||
name: 'This is panel header 3' | ||
} | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,10 @@ | |
} | ||
} | ||
|
||
.@{collapse-prefix-cls}-extra { | ||
float: right; | ||
} | ||
|
||
&:focus { | ||
outline: none; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters