简体   繁体   中英

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 . 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. You can use importHref together with an observer on a route change to lazy load pages for iron-pages . See here for code sample

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

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