38 lines
760 B
Vue
38 lines
760 B
Vue
<template>
|
|
<div v-if="isNested">
|
|
<div v-for="category in props.routers.items" :key="category.text">
|
|
<h3>{{ category.text }}</h3>
|
|
<ul>
|
|
<li v-for="item in category.items" :key="item.text">
|
|
<a :href="withBase(item.link)">{{ item.text }}</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div v-else>
|
|
<ul>
|
|
<li v-for="item in props.routers.items" :key="item.text">
|
|
<a :href="withBase(item.link)">{{ item.text }}</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { withBase } from 'vitepress'
|
|
import { defineProps } from 'vue'
|
|
|
|
const props = defineProps({
|
|
routers: {
|
|
required: true,
|
|
type: Object
|
|
},
|
|
isNested: {
|
|
type: Boolean,
|
|
default: false
|
|
}
|
|
})
|
|
</script>
|
|
|