简体   繁体   中英

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.

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. 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.

Example:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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