Использование
Компонент PageAnchors выводит список ссылок: на разделы документации, внешние ресурсы, релизы. Текущая ссылка выделена, у ссылки в новой вкладке — значок.
<script setup lang="ts">
import type { PageAnchor } from '@bxshefby/b24ui-nuxt'
const links = ref<PageAnchor[]>([
{
label: 'Документация',
icon: 'i-bx24-outline-file',
to: '/docs/getting-started/'
},
{
label: 'Компоненты',
icon: 'i-bx24-outline-folder',
to: '/docs/components/'
},
{
label: 'Шаблоны',
icon: 'i-bx24-outline-screen',
to: 'https://github.com/bx-shef/b24-ui/tree/main/playgrounds',
target: '_blank'
},
{
label: 'Релизы',
icon: 'i-bx24-outline-tag',
to: 'https://github.com/bx-shef/b24-ui/releases',
target: '_blank'
}
])
</script>
<template>
<B24PageAnchors :links="links" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import type { PageAnchor } from '@bxshefby/b24ui-nuxt'
const links = ref<PageAnchor[]>([
{
label: 'Документация',
icon: 'i-bx24-outline-file',
to: '/docs/getting-started/'
},
{
label: 'Компоненты',
icon: 'i-bx24-outline-folder',
to: '/docs/components/'
},
{
label: 'Шаблоны',
icon: 'i-bx24-outline-screen',
to: 'https://github.com/bx-shef/b24-ui/tree/main/playgrounds',
target: '_blank'
},
{
label: 'Релизы',
icon: 'i-bx24-outline-tag',
to: 'https://github.com/bx-shef/b24-ui/releases',
target: '_blank'
}
])
</script>
<template>
<B24PageAnchors :links="links" />
</template>
Ссылки
Пропс links — массив объектов со свойствами:
label: stringicon?: IconPropclass?: anyb24ui?: { item?: ClassNameValue, link?: ClassNameValue, linkLabel?: ClassNameValue, linkLabelExternalIcon?: ClassNameValue, linkLeading?: ClassNameValue, linkLeadingIcon?: ClassNameValue }
Можно передать любое свойство компонента Link, например to, target и другие.
<script setup lang="ts">
import type { PageAnchor } from '@bxshefby/b24ui-nuxt'
const links = ref<PageAnchor[]>([
{
label: 'Документация',
icon: 'i-bx24-outline-file',
to: '/docs/getting-started/'
},
{
label: 'Компоненты',
icon: 'i-bx24-outline-folder',
to: '/docs/components/'
},
{
label: 'Шаблоны',
icon: 'i-bx24-outline-screen',
to: 'https://github.com/bx-shef/b24-ui/tree/main/playgrounds',
target: '_blank'
},
{
label: 'Релизы',
icon: 'i-bx24-outline-tag',
to: 'https://github.com/bx-shef/b24-ui/releases',
target: '_blank'
}
])
</script>
<template>
<B24PageAnchors :links="links" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import type { PageAnchor } from '@bxshefby/b24ui-nuxt'
const links = ref<PageAnchor[]>([
{
label: 'Документация',
icon: 'i-bx24-outline-file',
to: '/docs/getting-started/'
},
{
label: 'Компоненты',
icon: 'i-bx24-outline-folder',
to: '/docs/components/'
},
{
label: 'Шаблоны',
icon: 'i-bx24-outline-screen',
to: 'https://github.com/bx-shef/b24-ui/tree/main/playgrounds',
target: '_blank'
},
{
label: 'Релизы',
icon: 'i-bx24-outline-tag',
to: 'https://github.com/bx-shef/b24-ui/releases',
target: '_blank'
}
])
</script>
<template>
<B24PageAnchors :links="links" />
</template>
icon — компонент иконки или имя Iconify из набора bx24, например 'i-bx24-outline-file'.Примеры
В раскладке
PageAnchors внутри PageAside выводит ссылки над навигацией по разделам (NavigationMenu).
layouts/docs.vue
<script setup lang="ts">
import type { NavigationMenuItem, PageAnchor } from '@bxshefby/b24ui-nuxt'
const navigation: NavigationMenuItem[] = [{
label: 'Начало работы',
to: '/docs/getting-started'
}, {
label: 'Компоненты',
to: '/docs/components'
}]
const links: PageAnchor[] = [{
label: 'Документация',
icon: 'i-bx24-outline-file',
to: '/docs/getting-started'
}, {
label: 'Компоненты',
icon: 'i-bx24-outline-folder',
to: '/docs/components'
}, {
label: 'Шаблоны',
icon: 'i-bx24-outline-screen',
to: 'https://github.com/bx-shef/b24-ui/tree/main/playgrounds',
target: '_blank'
}, {
label: 'Релизы',
icon: 'i-bx24-outline-tag',
to: 'https://github.com/bx-shef/b24-ui/releases',
target: '_blank'
}]
</script>
<template>
<B24Page>
<template #left>
<B24PageAside>
<B24PageAnchors :links="links" />
<B24Separator type="dashed" />
<B24NavigationMenu :items="navigation" orientation="vertical" />
</B24PageAside>
</template>
<slot />
</B24Page>
</template>
API
Пропсы
Слоты
Тема
Page
Сетка страницы из трёх колонок: левая боковая панель, область основного содержимого и правая боковая панель.
PageAside
Липкая боковая навигация.
Была ли страница полезна?