题:
How do I automatically execute a function whenever my
<paper-dialog>
element is closed?
版本:聚合物1.0
码:
<paper-dialog id="paper-id" entry-animation="scale-up-animation" exit-animation="scale-down-animation"> <sample-element></sample-element> </paper-dialog>
解决方法
paper-dialog继承了Polymer.IronOverlayBehavior,它具有iron-overlay-opened和iron-overlay-closed事件.
<paper-dialog on-iron-overlay-opened="_myOpenFunction" on-iron-overlay-closed="_myClosedFunction"></paper-dialog>