惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
G
Google Developers Blog
M
MIT News - Artificial intelligence
Vercel News
Vercel News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
B
Blog RSS Feed
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
V
Visual Studio Blog
Stack Overflow Blog
Stack Overflow Blog
雷峰网
雷峰网
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Fortinet All Blogs
L
LangChain Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
B
Blog
J
Java Code Geeks
Hugging Face - Blog
Hugging Face - Blog
I
InfoQ
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

Hyde Blog

Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog
Hyde Blog
Hyde · 2025-10-05 · via Hyde Blog

回到顶部提示 ​

提示

teek 主题已支持回到顶部提示配置,详情查看全局配置

  • vitepress-theme-Teek\src\components\RightBottomButton\src\index.vue中添加以下代码

vue

<script setup lang="ts" name="RightBottomButton">
import { ElMessage } from 'element-plus' // 引入消息提示功能
import 'element-plus/es/components/message/style/css'
<script>
  • 修改前

vue

<script>
const scrollToTop = useDebounce(() => {
  scrollTo("html", 0, 1500);
  scrollTop.value = 0;
}, 500);
<script>
  • 修改后

vue

<script setup lang="ts" name="RightBottomButton">
const scrollToTop = useDebounce(() => {
  scrollTo("html", 0, 1500, () => {
    // 添加Element Plus消息提示
    ElMessage({
      message: '已回到顶部',// 消息内容
      type: 'success',  // 消息类型为成功
      duration: 3000  // 持续时间为3秒
    });
  });
  scrollTop.value = 0;
}, 500);
<script>