mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 09:20:51 +08:00
91 lines
1.6 KiB
Vue
91 lines
1.6 KiB
Vue
<script setup lang="ts">
|
|
import { withBase } from 'vitepress'
|
|
import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'
|
|
import { usePageNav } from '../../composables/page-nav'
|
|
|
|
const { hasLinks, prev, next } = usePageNav()
|
|
</script>
|
|
|
|
<template>
|
|
<div v-if="hasLinks" class="next-and-prev-link">
|
|
<div class="container">
|
|
<div class="prev">
|
|
<a v-if="prev" class="link" :href="withBase(prev.link)">
|
|
<ElIcon>
|
|
<ArrowLeft />
|
|
</ElIcon>
|
|
<span class="text">{{ prev.text }}</span>
|
|
</a>
|
|
</div>
|
|
<div class="next">
|
|
<a v-if="next" class="link" :href="withBase(next.link)">
|
|
<span class="text">{{ next.text }}</span>
|
|
<ElIcon>
|
|
<ArrowRight />
|
|
</ElIcon>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.next-and-prev-link {
|
|
padding-top: 1rem;
|
|
}
|
|
|
|
.container {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
border-top: 1px solid var(--border-color);
|
|
padding-top: 1rem;
|
|
}
|
|
|
|
.prev,
|
|
.next {
|
|
display: flex;
|
|
flex-shrink: 0;
|
|
width: 50%;
|
|
}
|
|
|
|
.prev {
|
|
justify-content: flex-start;
|
|
padding-right: 12px;
|
|
}
|
|
|
|
.next {
|
|
justify-content: flex-end;
|
|
padding-left: 12px;
|
|
}
|
|
|
|
.link {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
max-width: 100%;
|
|
font-size: 1rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.text {
|
|
display: block;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.el-icon {
|
|
display: block;
|
|
flex-shrink: 0;
|
|
font-size: 1rem;
|
|
color: var(--text-color);
|
|
transform: translateY(1px);
|
|
}
|
|
|
|
.icon-prev {
|
|
margin-right: 8px;
|
|
}
|
|
.icon-next {
|
|
margin-left: 8px;
|
|
}
|
|
</style>
|