feat: 添加首页重置功能- 在首页标题上添加点击事件,实现重置到首页视图的功能

- 重置功能包括清空已选文件和笔记列表
- 更新相关代码,增加必要的导入和实现
This commit is contained in:
2025-07-31 15:55:18 +08:00
parent d6d3401bb0
commit 8bd811319e
2 changed files with 7 additions and 2 deletions

View File

@@ -56,7 +56,7 @@
<div v-else> <div v-else>
<el-header class="header"> <el-header class="header">
<h1>我的笔记</h1> <h1 @click="resetToHomeView" style="cursor: pointer;">我的笔记</h1>
<div class="actions"> <div class="actions">
<el-input <el-input
v-model="searchKeyword" v-model="searchKeyword"
@@ -196,7 +196,7 @@
<script setup> <script setup>
import {onMounted, ref, nextTick, watch, h, computed} from 'vue'; import {onMounted, ref, nextTick, watch, h, computed} from 'vue';
import {ElMessage, ElSubMenu, ElMenuItem, ElIcon} from 'element-plus'; import {ElMessage, ElSubMenu, ElMenuItem, ElIcon, ElMessageBox} from 'element-plus';
import Vditor from 'vditor'; import Vditor from 'vditor';
import 'vditor/dist/index.css'; import 'vditor/dist/index.css';
import { import {
@@ -795,6 +795,11 @@ const handleDeleteGroup = async (group) => {
} }
} }
}; };
const resetToHomeView = () => {
selectedFile.value = null;
groupMarkdownFiles.value = []; // 清空笔记列表
};
</script> </script>
<style> <style>

Binary file not shown.