SidebarNav
Vertical nav list
A site's section list down the side — the pages of a manual, the sections of an official site. On phones it usually moves into a Drawer.
Basic
vue
<script setup lang="ts">
import { ref } from "vue";
import { BlessSidebarNav } from "blessing-ui";
import { navItems } from "./_nav";
const active = ref("#news");
</script>
<template>
<div style="max-width: 220px">
<BlessSidebarNav
:items="navItems"
:active
@select="
(i, e) => {
if (!i.external) {
e.preventDefault();
active = i.href;
}
}
"
/>
</div>
</template>- Links go through your router when one is provided;
activemarks the current page (aria-current="page");externalkeeps a link a plain<a>. metaadds a dated line after a dash;badge: trueshows NEW!.
Usage
ts
import { BlessSidebarNav } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
items* | BlessNavItem[] | — | |
active | string | — | |
label | string | "Main" |
Events
| Name | Payload | Description |
|---|---|---|
select | [item: BlessNavItem, event: MouseEvent] |
Slots
| Name | Scope | Description |
|---|---|---|
item | { item: BlessNavItem; } |