This repository was archived by the owner on Jan 6, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathroutes.vue
59 lines (58 loc) · 1.98 KB
/
routes.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<script setup lang="ts">
import { Pane, Splitpanes } from 'splitpanes'
import { router } from '../logic/app'
import { activeRouteRecordIndex, activeRouteRecordMatcherState, routeRecordMatcherState, toggleRouteRecordMatcher } from '../logic/routes'
</script>
<template>
<div v-if="router" h-screen n-panel-grids>
<Splitpanes>
<Pane border="r base" size="40">
<div h-screen select-none overflow-scroll p-2 class="no-scrollbar">
<div
v-for="(item, index) in routeRecordMatcherState"
:key="index"
vue-block
:class="[activeRouteRecordIndex === index ? 'vue-block-active' : 'vue-block-hover']"
@click="toggleRouteRecordMatcher(index)"
>
<h3 vue-block-title>
<span :class="[activeRouteRecordIndex === index && 'text-white']">
{{ item.path }}
<template
v-for="(tag, childIndex) in item.tags"
>
<VBadge
v-if="tag.label"
:key="childIndex"
color="white/90 dark:black/90"
:style="{
backgroundColor: `#${tag.bgColor.toString(16)}`,
}"
>
{{ tag.label }}
</VBadge>
</template>
</span>
</h3>
</div>
</div>
</Pane>
<Pane min-size="8" size="60">
<div h-screen select-none overflow-scroll p-2 class="no-scrollbar">
<StateFields :data="activeRouteRecordMatcherState" />
</div>
</Pane>
</Splitpanes>
</div>
<VPanelGrids v-else px5>
<VCard flex="~ col gap2" min-w-30 items-center p3>
<TabIcon mb2 text-5xl icon="i-logos-vue" title="Vue Router" />
<h1 text-xl>
Install Vue Router
</h1>
<p text-sm op50>
It seems you don't have vue-router installed.
</p>
</VCard>
</VPanelGrids>
</template>