[英]I want to rerun “ready” event of polymer-element under dom-if template
如果子元素在“ dom-if”模板下可见,我想重新运行该子元素的“就绪”事件。
有什么技巧可以重新运行子元素的“就绪”事件?
代码如下。 在这种情况下,我想重新运行猫头鹰元素的“就绪”事件
<template is="dom-if" if="{{isPlugin(config.plugin,'owl')}}" id="owl"> <owl-element html$="{{config.html}}" autoplay-speed$="{{config.speed}}" tranisition$="{{config.transition}}" on-box-update="gotoNextBox"> </owl-element> </template>
Dom-if仅将元素隐藏在dom中,但不会销毁它。 这是由于操作更快。 您可以为dom-if添加一个“ restamp”属性,这使得dom-if元素在每次显示时都会重新创建。
例:
<template is="dom-if" if="{{isPlugin(config.plugin,'owl')}}" id="owl" restamp>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.