Nuxt UI v3-alpha 已发布!

试用

导航手风琴

一个预先样式化的手风琴,显示在导航树中。

用法

此组件由 导航树 内部使用。

<script setup lang="ts">
const links = [{
  label: 'Getting Started',
  icon: 'i-heroicons-book-open',
  children: [{
    label: 'Introduction',
    to: '/getting-started'
  }, {
    label: 'Installation',
    to: '/pro/getting-started/installation'
  }, {
    label: 'Theming',
    to: '/pro/getting-started/theming'
  }, {
    label: 'Structure',
    to: '/pro/getting-started/structure'
  }, {
    label: 'Content',
    to: '/pro/getting-started/content'
  }]
}]
</script>

<template>
  <UNavigationAccordion :links="links" />
</template>

属性

ui
任何
{}
defaultOpen
数字 | 布尔值
未定义
links
NavigationTree[]
[]
level
数字
0
multiple
布尔值
true

配置

{
  wrapper: 'space-y-3',
  container: 'space-y-3',
  item: {
    padding: '',
    color: 'text-inherit dark:text-inherit'
  },
  button: {
    base: 'flex items-center gap-1.5 group w-full focus-visible:outline-primary',
    active: 'text-primary border-current',
    inactive: 'border-transparent',
    level: 'border-l -ml-px pl-3.5',
    icon: {
      base: 'w-5 h-5 flex-shrink-0'
    },
    trailingIcon: {
      name: 'i-heroicons-chevron-down-20-solid',
      base: 'w-5 h-5 ms-auto transform transition-transform duration-200 flex-shrink-0 mr-1.5',
      active: 'text-gray-700 dark:text-gray-200',
      inactive: 'text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-200 -rotate-90'
    },
    label: 'text-sm/6 font-semibold truncate'
  },
  tree: 'border-l border-gray-200 dark:border-gray-800',
  links: {}
}