我用烙鐵元素重定向我的用戶有我的主要元素: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