RouteReuseStrategy
提供一种自定义复用已激活路由的方式。
Provides a way to customize when activated routes get reused.
abstract class RouteReuseStrategy {
abstract shouldDetach(route: ActivatedRouteSnapshot): boolean
abstract store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle): void
abstract shouldAttach(route: ActivatedRouteSnapshot): boolean
abstract retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null
abstract shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean
}
方法
确定是否应分离此路由(及其子树)以便以后复用 Determines if this route (and its subtree) should be detached to be reused later | |||
参数
返回值
|
存储分离的路由。 Stores the detached route. | ||||||
参数
返回值
| ||||||
存储 Storing a |
确定是否应重新连接此路由(及其子树) Determines if this route (and its subtree) should be reattached | |||
参数
返回值
|
检索以前存储的路由 Retrieves the previously stored route | |||
参数
返回值
|
确定是否应复用路由 Determines if a route should be reused | ||||||
参数
返回值
|