mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-21 02:50:11 +08:00
d8954f945e
* chore: make eslints work in docs folder * refactor(dev): improve eslint * fix eslint issue Co-authored-by: Kevin <sxzz@sxzz.moe> Co-authored-by: jeremywuuuuu <15975785+JeremyWuuuuu@users.noreply.github.com>
32 lines
820 B
Vue
32 lines
820 B
Vue
<script lang="ts" setup>
|
|
import { useSidebar } from '../composables/sidebar'
|
|
|
|
import VPSidebarLink from './sidebar/vp-sidebar-link.vue'
|
|
|
|
defineProps<{ open: boolean }>()
|
|
defineEmits(['close'])
|
|
|
|
// const isHome = useIsHome()
|
|
const { sidebars, hasSidebar } = useSidebar()
|
|
</script>
|
|
|
|
<template>
|
|
<aside v-if="hasSidebar" :class="{ sidebar: true, open }">
|
|
<slot name="top" />
|
|
<div class="sidebar-groups">
|
|
<section v-for="(item, key) of sidebars" :key="key" class="sidebar-group">
|
|
<p class="sidebar-group__title">
|
|
{{ item.text }}
|
|
</p>
|
|
<VPSidebarLink
|
|
v-for="(child, childKey) in item.children"
|
|
:key="childKey"
|
|
:item="child"
|
|
@close="$emit('close')"
|
|
/>
|
|
</section>
|
|
</div>
|
|
<slot name="bottom" />
|
|
</aside>
|
|
</template>
|