Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module: select): support placement (#7537)
Co-authored-by: luolei <luolei@kuaishou.com>
- Loading branch information
Showing
7 changed files
with
158 additions
and
8 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: 25 | ||
title: | ||
zh-CN: 弹出位置 | ||
en-US: Placement | ||
--- | ||
|
||
## zh-CN | ||
|
||
可以通过 `placement` 手动指定弹出的位置。 | ||
|
||
## en-US | ||
|
||
You can manually specify the position of the popup via `placement`. |
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,33 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { NzSelectPlacementType } from 'ng-zorro-antd/select'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-select-placement', | ||
template: ` | ||
<nz-radio-group [(ngModel)]="placement"> | ||
<label nz-radio-button nzValue="topLeft">topLeft</label> | ||
<label nz-radio-button nzValue="topRight">topRight</label> | ||
<label nz-radio-button nzValue="bottomLeft">bottomLeft</label> | ||
<label nz-radio-button nzValue="bottomRight">bottomRight</label> | ||
</nz-radio-group> | ||
<br /> | ||
<br /> | ||
<nz-select [(ngModel)]="selectedValue" [nzDropdownMatchSelectWidth]="false" [nzPlacement]="placement"> | ||
<nz-option nzValue="HangZhou" nzLabel="HangZhou #310000"></nz-option> | ||
<nz-option nzValue="NingBo" nzLabel="NingBo #315000"></nz-option> | ||
<nz-option nzValue="WenZhou" nzLabel="WenZhou #325000"></nz-option> | ||
</nz-select> | ||
`, | ||
styles: [ | ||
` | ||
nz-select { | ||
width: 120px; | ||
} | ||
` | ||
] | ||
}) | ||
export class NzDemoSelectPlacementComponent { | ||
placement: NzSelectPlacementType = 'topLeft'; | ||
selectedValue = 'HangZhou'; | ||
} |
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