-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module:modal): draggable (#8419)
- Loading branch information
1 parent
ec7ec35
commit ce33294
Showing
9 changed files
with
116 additions
and
15 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: 11 | ||
title: | ||
zh-CN: 基本 | ||
en-US: Draggable | ||
--- | ||
|
||
## zh-CN | ||
|
||
可拖动模态。 | ||
|
||
## en-US | ||
|
||
Draggable modal. |
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,43 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-modal-draggable', | ||
template: ` | ||
<button nz-button nzType="default" (click)="showModal()"> | ||
<span>Open Draggable Modal</span> | ||
</button> | ||
<nz-modal | ||
nzDraggable | ||
nzCentered | ||
[(nzVisible)]="isVisible" | ||
nzTitle="Draggable Modal" | ||
(nzOnCancel)="handleCancel()" | ||
(nzOnOk)="handleOk()" | ||
> | ||
<ng-container *nzModalContent> | ||
<p>Just don't learn physics at school and your life will be full of magic and miracles.</p> | ||
<p>Day before yesterday I saw a rabbit, and yesterday a deer, and today, you.</p> | ||
</ng-container> | ||
</nz-modal> | ||
` | ||
}) | ||
export class NzDemoModalDraggableComponent { | ||
isVisible = false; | ||
|
||
constructor() {} | ||
|
||
showModal(): void { | ||
this.isVisible = true; | ||
} | ||
|
||
handleOk(): void { | ||
console.log('Button ok clicked!'); | ||
this.isVisible = false; | ||
} | ||
|
||
handleCancel(): void { | ||
console.log('Button cancel clicked!'); | ||
this.isVisible = false; | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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