mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 01:11:25 +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>
24 lines
679 B
Vue
24 lines
679 B
Vue
<script setup lang="ts">
|
|
import { useSidebar } from '../composables/sidebar'
|
|
import { useBackTop } from '../composables/back-top'
|
|
import ToggleSidebarBtn from './subnav/toggle-sidebar-btn.vue'
|
|
defineEmits(['open-menu'])
|
|
|
|
const { hasSidebar } = useSidebar()
|
|
const { shouldShow, scrollToTop } = useBackTop()
|
|
</script>
|
|
|
|
<template>
|
|
<div class="sub-nav">
|
|
<ToggleSidebarBtn v-if="hasSidebar" @click="$emit('open-menu')" />
|
|
<Transition name="shifting">
|
|
<ElButton
|
|
type="text"
|
|
:class="{ 'go-back-top': true, show: shouldShow }"
|
|
@click.prevent.stop="scrollToTop"
|
|
>{{ 'Back to top' }}</ElButton
|
|
>
|
|
</Transition>
|
|
</div>
|
|
</template>
|