-
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:image): add scale step (#8163)
* feat(module:image): add zoom step * feat(module:image): add zoom step * feat(module:image): add scale step * feat(module:image): add scale step * feat(module:image): add scale step * feat(module:image): add scale step * feat(module:image): add scale step * feat(module:image): add scale step
- Loading branch information
1 parent
211db31
commit 5aa4db9
Showing
12 changed files
with
314 additions
and
83 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
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: 6 | ||
title: | ||
zh-CN: 受控的预览 | ||
en-US: Controlled Preview | ||
--- | ||
|
||
## zh-CN | ||
|
||
可以使预览受控。 | ||
|
||
## en-US | ||
|
||
You can make preview controlled. |
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,48 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { NzImageService } from 'ng-zorro-antd/image'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-image-controlled-preview', | ||
template: ` | ||
<div> | ||
<label> | ||
<span>scale step:</span> | ||
<nz-input-number [(ngModel)]="scaleStep" [nzMin]="0.1" [nzStep]="1"></nz-input-number> | ||
</label> | ||
<button nz-button nzType="primary" (click)="onClick()">Preview</button> | ||
</div> | ||
`, | ||
styles: [ | ||
` | ||
div { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 1rem; | ||
} | ||
label { | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5rem; | ||
} | ||
` | ||
] | ||
}) | ||
export class NzDemoImageControlledPreviewComponent { | ||
scaleStep: number = 0.5; | ||
|
||
constructor(private nzImageService: NzImageService) {} | ||
|
||
onClick(): void { | ||
const images = [ | ||
{ | ||
src: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', | ||
alt: '' | ||
} | ||
]; | ||
this.nzImageService.preview(images, { nzZoom: 1, nzRotate: 0, nzScaleStep: this.scaleStep }); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { NzImageModule } from 'ng-zorro-antd/image'; | ||
import { NzButtonModule } from 'ng-zorro-antd/button'; | ||
import { NzSpaceModule } from 'ng-zorro-antd/space'; | ||
import { NzInputNumberModule } from 'ng-zorro-antd/input-number'; | ||
|
||
export const moduleList = [ NzImageModule, NzButtonModule, NzSpaceModule ]; | ||
export const moduleList = [ NzImageModule, NzButtonModule, NzSpaceModule, NzInputNumberModule ]; |
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
Oops, something went wrong.