mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-16 02:11:48 +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>
26 lines
830 B
Vue
26 lines
830 B
Vue
<script setup lang="ts">
|
|
import { useSidebar } from '../composables/sidebar'
|
|
import { useFullScreen } from '../composables/fullscreen'
|
|
import { useToggleWidgets } from '../composables/toggle-widgets'
|
|
import { breakpoints } from '../constant'
|
|
import VpNavbar from './vp-navbar.vue'
|
|
import VpNavFull from './vp-nav-full.vue'
|
|
|
|
const { hasSidebar } = useSidebar()
|
|
const { toggleFullScreen, isFullScreen } = useFullScreen()
|
|
const close = () => toggleFullScreen(false)
|
|
|
|
useToggleWidgets(isFullScreen, () => {
|
|
if (window.outerWidth >= breakpoints.md) {
|
|
close()
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<header :class="{ navbar: true, 'has-sidebar': hasSidebar }">
|
|
<VpNavbar :full-screen="isFullScreen" @toggle="toggleFullScreen" />
|
|
<VpNavFull :full-screen="isFullScreen" class="full-screen" @close="close" />
|
|
</header>
|
|
</template>
|