如何为Polymer 1.0执行on-close或dismiss的函数?

前端之家收集整理的这篇文章主要介绍了如何为Polymer 1.0执行on-close或dismiss的函数?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
题:

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>

https://elements.polymer-project.org/elements/iron-overlay-behavior?active=Polymer.IronOverlayBehavior

原文链接:https://www.f2er.com/html/226021.html

猜你在找的HTML相关文章