Reputation: 881
When using @Route
, it is possible to define a RouterLayout
with the attribute layout
. However, I would like to define a global default layout. Is it possible to define the layout in a method, or configure a different default than <body>
somehow?
Upvotes: 1
Views: 121
Reputation: 4275
You can define a parent layout for any RouterLayout with the @ParentLayout
annotation:
@ParentLayout(MyParentLayout.class)
public class MyRouterLayout extends Div implements RouterLayout {
...
Here MyRouterLayout
will be shown inside MyParentLayout
, not <body>
.
Upvotes: 1