简体   繁体   English

我想在dom-if模板下重新运行聚合物元素的“就绪”事件

[英]I want to rerun “ready” event of polymer-element under dom-if template

if child element is visible under "dom-if" template, I want to rerun "ready" event of the child element. 如果子元素在“ dom-if”模板下可见,我想重新运行该子元素的“就绪”事件。

are there any tips to rerun "ready" event of the child element? 有什么技巧可以重新运行子元素的“就绪”事件?

The code is like below. 代码如下。 in this case, I want to rerun "ready" event of owl-element 在这种情况下,我想重新运行猫头鹰元素的“就绪”事件

 <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 just hides element from the dom, but not destroy it. Dom-if仅将元素隐藏在dom中,但不会销毁它。 This is due to faster operation. 这是由于操作更快。 You can add a 'restamp'-attribute to dom-if, which makes the dom-if elements recreate everytime it displays. 您可以为dom-if添加一个“ restamp”属性,这使得dom-if元素在每次显示时都会重新创建。

Example: 例:

 <template is="dom-if" if="{{isPlugin(config.plugin,'owl')}}" id="owl" restamp>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM