Skip to content

NaiveLayoutSidebar

This component can be used for page layout with sidebar. It's based on naive-ui layout.

ts
interface MenuLinkRoute {
  label: string;
  icon?: string;
  to?: RouteLocationRaw;
  children?: MenuLinkRoute[];
}

Props

NameTypeDefaultNote
nativeScrollbarbooleanfalse
routesMenuLinkRoute[ ]The routes for the sidebar
drawerRoutesMenuLinkRoute[ ]The routes for the drawer
drawerClosablebooleantrueWhether the drawer content is closable
drawerWidthstring | number100%
drawerPlacementtop | right | bottom | leftleft
toggleIconstringph:equals
togglePlacementright | leftright
siderLayoutSiderPropsPassed to n-layout-sider, docs

Slots

  • start, placed at the top of the sidebar.
  • end, placed at the bottom of the sidebar.
  • drawer-header, placed at the top of the drawer.
  • drawer-footer, placed at the bottom of the drawer.
  • default, the content of the page.