You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Support request => Please do not submit support request here
Current behavior
目前的modal组件只能通过中间变量开启和关闭,有些情景下很麻烦
<!--the current `nz-modal` component can only be open/closed by intermediate variables--><buttonnz-button(click)="modal.nzVisible=true"><span>show modal</span></button><nz-modal#modal[nzTitle]="'喵喵喵'" [nzContent]="'汪!汪!汪!'"
(nzOnCancel)="modal.nzVisible=false"></nz-modal>
Expected behavior
如果有了open和close方法就方便很多(而且对原有的功能也没有任何影响)
<!-- by using the #modal var, now we can easily open/close the modal --><buttonnz-button(click)="modal.open()"><span>show modal</span></button><nz-modal#modal[nzTitle]="'喵喵喵'" [nzContent]="'汪!汪!汪!'"
(nzOnCancel)="modal.close()"></nz-modal>
//too many vars make us confused(especially when you have many modals)isXXXModalLoading=false;isXXXModalOpen=false;isYYYModalLoading=false;isYYYModalOpen=false;
suppose to be:
//one var for all
@ViewChild("modalA")modalA;
@ViewChild("modalB")modalB;//use:modalA.open()modalA.setLoading(true)modalA.setLoading(false)modalA.close()
The text was updated successfully, but these errors were encountered:
spawpaw
changed the title
Modal组件功能建议(为Modal添加open()和close()方法)
Modal组件功能建议(open() and close() for Modal)
Aug 21, 2017
…#125)
use #modal.open() instead of set nzVisible=true
use #modal.close() instead of set nzVisible=false
use #modal.setConfirmLoading(loading:boolean) instead of set confirmLoading
close#118
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.
lockbot
locked as resolved and limited conversation to collaborators
Feb 19, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm submitting a...
Current behavior
目前的modal组件只能通过中间变量开启和关闭,有些情景下很麻烦
Expected behavior
如果有了open和close方法就方便很多(而且对原有的功能也没有任何影响)
如果可以,还可以添加其他方法,如
isOpen()
,setLoading(boolean)等,这样在ts中只要添加一个ViewChild变量就可以了,而不是各种标识变量current:
suppose to be:
The text was updated successfully, but these errors were encountered: