lwr-router-container
A router container provides navigation context by processing all navigation wires and events from its descendants in the DOM.
Property | Type | Required/Optional | Description |
---|---|---|---|
router | Router object | Optional | Obtained from the createRouter() API. |
history-disabled | Boolean | Optional | Set history-disabled to true if your router container shouldn't alter the browser's History API during navigation events or location changes. |
A router container fires these events:
-
onhandlenavigation
- Dispatched when
navigate(pageRef)
is called.event.preventDefault()
cancels the navigation event.event.detail
is thePageReference
.
- Dispatched when
-
onprenavigate
-
Dispatched when a navigation event is received and a
RouteDefinition
match is found.event.preventDefault()
cancels the navigation event.event.detail
is aRouteChange
object.
-
-
onpostnavigate
-
Dispatched when a navigation event has completed.
event.detail
is aDomRoutingMatch
object for the current location.
-
-
onerrornavigate
-
Dispatched when there's an error processing a navigation event. (For example, no
RouteDefinition
match or aprenavigate
cancellation.)event.detail
is aMessageObject
.
-
See Also