我用烙铁元素重定向我的用户有我的主要元素:WebComponentsReady不重新触发
....
<template if="{{route != null}}">
<template if="{{route == 'home' || route == ''}}">
<home-element structure="{{home}}"></home-element>
</template>
<template if="{{route == 'research'}}">
<research-element structure="{{research}}"></research-element>
</template>
<template if="{{route == 'highlights'}}">
<!-- <highlights-element></highlights-element> -->
</template>
</template>
....
....
Polymer('research-element', {
name: 'research',
ready: function(){
// wait for the WebComponent to be ready to hook up jquery
var self = this;
addEventListener('polymer-ready', function() {
window.console.log($('#'+self.name+'-affix'));
$('#'+self.name+'-affix').affix();
});
....
1在登录(#home),用户获得定向到“家元” ,并且WebComponentsReady被正确触发。
2-如果我想要转到另一个页面(#research),用户将被引导到'research-element'。值得注意的是,一旦“研究元素”准备就绪,WebComponentsReady就不会重新启动。
预计还是我做错了什么?
另外,还有什么好的方法来缓存元素,一旦他们被加载?
最佳, 萨科
太棒了正是我所期待的 – Nicolas