1
1
<script lang="ts" setup>
2
2
import { NAnchor , NAnchorLink , NCard , NLayout , NLayoutSider } from ' naive-ui' ;
3
3
4
- import { onDeactivated , type Ref , ref } from ' vue' ;
4
+ import { type Component , onDeactivated , type Ref , ref } from ' vue' ;
5
+
6
+ import SettingsLinks from ' ~/components/views/settings/SettingsLinks.vue' ;
5
7
6
8
import { useI18n } from ' ~/utils' ;
7
9
@@ -10,14 +12,15 @@ const i18n = useI18n('settings');
10
12
type Section = {
11
13
title: string ;
12
14
reference: Ref <[InstanceType <typeof NCard >] | undefined >;
15
+ component? : Component ;
13
16
};
14
17
15
18
const sections: Section [] = [
16
19
{ title: ' menu__account' , reference: ref () },
17
- { title: ' menu__cache' , reference: ref () },
18
20
{ title: ' menu__tabs' , reference: ref () },
21
+ { title: ' menu__links' , reference: ref (), component: SettingsLinks },
22
+ { title: ' menu__cache' , reference: ref () },
19
23
{ title: ' menu__logs' , reference: ref () },
20
- { title: ' menu__links' , reference: ref () },
21
24
];
22
25
23
26
const focus = ref ();
@@ -78,17 +81,18 @@ onDeactivated(() => {
78
81
}"
79
82
>
80
83
<NCard
81
- v-for =" section in sections"
84
+ v-for =" ( section, index) in sections"
82
85
:id =" section.title"
83
86
:ref =" section.reference"
84
87
:key =" section.title"
85
88
class =" card"
86
89
:class =" { target: focus?.title === section.title }"
90
+ :style =" { '--index': sections.length - index }"
87
91
:title =" i18n(section.title)"
88
92
@mouseenter =" onEnter(section)"
89
93
@mouseleave =" onLeave(section)"
90
94
>
91
- card Content
95
+ < component :is = " section.component " />
92
96
</NCard >
93
97
</NLayout >
94
98
</NLayout >
@@ -107,6 +111,7 @@ onDeactivated(() => {
107
111
.card {
108
112
@include mixin .hover-background ($from : var (--bg-black-50 ), $to : var (--bg-color-80 ));
109
113
114
+ z-index : var (--index );
110
115
min-height : 20rem ;
111
116
112
117
& :not (:last-child ) {
0 commit comments