RouteDestination
RouteDestination contains a ViewSet object. RouteHandler.new() takes a RouteHandlerCallback containing a RouteDestination. RouteHandler.update() takes a RouteHandlerCallback containing a RouteDestination.
| Property | Type | Required/Optional | Description |
|---|---|---|---|
viewset | A ViewSet object | Required | A ViewSet object that specifies the view to display. |
The view to display. Supply a ViewSet object to a RouteDestination.
| Property | Type | Required/Optional | Description |
|---|---|---|---|
viewName | String | Required | The viewName key maps to the viewName property for the outlet. It accepts either:
|
In LWR, modules are always provided via a Promise object. Promises allow the module code to be lazily loaded, improving application performance.
If a single page reference maps to more than one view, you can specify more than one outlet where each outputs a different view component. For example: { default: import('my/routeHandler'), sidebar: import('my/sideHandler'), footer: import('my/footerHandler') }. Check out Outlets for more information about using multiple outlets.
An object containing a Promise to a route handler module and a string specifier for the module. Supply a ViewInfo object to a ViewSet object.
| Property | Type | Required/Optional | Description |
|---|---|---|---|
module | Promise | Required | A promise to a route handler module. |
string | String | Required | A string specifier for the module, like my/recipePage. Simple or straightforward use cases typically don't require a specifier. In other cases, the specifier for the module can't be determined from a Promise alone, so you should manually define the module's string specifier for the route handler. |
See Also