lint:fix all
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<UContentNavigation
|
||||
:navigation="directoryNavigation"
|
||||
highlight
|
||||
<div>
|
||||
<UContentNavigation
|
||||
:navigation="directoryNavigation"
|
||||
highlight
|
||||
color="primary"
|
||||
variant="pill"
|
||||
/>
|
||||
@@ -18,8 +18,8 @@ const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
||||
// 处理导航数据,只显示一级目录和根目录文件
|
||||
const directoryNavigation = computed(() => {
|
||||
if (!navigation?.value) return []
|
||||
|
||||
return navigation.value.map(item => {
|
||||
|
||||
return navigation.value.map((item) => {
|
||||
// 如果是根目录文件(没有 children),直接返回
|
||||
if (!item.children || item.children.length === 0) {
|
||||
return {
|
||||
@@ -29,7 +29,7 @@ const directoryNavigation = computed(() => {
|
||||
active: Boolean(item.active)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 如果是一级目录,只保留目录本身,不显示子项
|
||||
return {
|
||||
title: item.title,
|
||||
@@ -45,4 +45,4 @@ const directoryNavigation = computed(() => {
|
||||
// 调试信息
|
||||
// console.log('ContentDirectory: Navigation data:', navigation.value)
|
||||
// console.log('ContentDirectory: Processed navigation:', directoryNavigation.value)
|
||||
</script>
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user