简体   繁体   English

聚合物1:防止铁页面/应用程序路线在加载时附加所有页面

[英]Polymer 1: Prevent iron-pages/app-route from attaching all pages at load

I am using Polymer 1 app-route with iron-pages like in the examples and starter-kit . 我正在将Polymer 1 app-route与示例和starter-kit中的iron-pages一起使用。 I find that all elements are attached on page load. 我发现所有元素都在页面加载时附加。 This causes quite abit of slow down at start. 这会在启动时造成相当大的减速。 How can I prevent this? 我该如何预防?

Polymer Staret Kit v2 which is based on the the PRPL pattern supports lazy loading of routes. 基于PRPL模式的 Polymer Staret Kit v2支持路由的延迟加载。 You can use importHref together with an observer on a route change to lazy load pages for iron-pages . 您可以将importHref与观察者一起用于更改iron-pages延迟加载页面的路由更改。 See here for code sample 参见此处获取代码示例

您也可以使用iron-lazy-ages ,当您更改到其端点的route时会加载页面。

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

相关问题 Rails 3:从控制器缓存*所有*页面,而无需手动添加它们 - Rails 3: Caching *all* pages from a controller without manually adding them 在单个页面上加载jQuery是否有助于整个网站页面加载时间? - Will loading jQuery on individual pages be helping with overall website pages load time? 如何确保phonegap js在具有多个单独页面的应用程序中仅加载一次? - how to do to make sure phonegap js load just once time in an app with many separate pages? 是否可以阻止在某些站点页面上加载.js文件来停止浏览器错误? - Can I prevent a .js file from loading on certain site pages to stop browser errors? 有时我网站上的页面加载速度很慢 - Sometimes pages on my website load very slowly 有效的网页加载速度更快吗? - Do valid web pages load faster? 防止某些文件夹在请求标头中附加cookie - Prevent certain folder from attaching cookies in request headers 从我的所有网站页面中删除 HTML 部分块会影响 SEO 和我的网站排名吗? - Will removing a HTML section block from my all website pages, affects SEO and my website rank? 更改网址时如何防止React-Route重新呈现整个应用程序 - How to prevent react-route from re-render the whole app when changing url 为不同的页面加载不同的js文件或一起加载? - load different js files for different pages or load together?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM