feat: 添加首页重置功能- 在首页标题上添加点击事件,实现重置到首页视图的功能
- 重置功能包括清空已选文件和笔记列表 - 更新相关代码,增加必要的导入和实现
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
|
||||
<div v-else>
|
||||
<el-header class="header">
|
||||
<h1>我的笔记</h1>
|
||||
<h1 @click="resetToHomeView" style="cursor: pointer;">我的笔记</h1>
|
||||
<div class="actions">
|
||||
<el-input
|
||||
v-model="searchKeyword"
|
||||
@@ -196,7 +196,7 @@
|
||||
|
||||
<script setup>
|
||||
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/dist/index.css';
|
||||
import {
|
||||
@@ -795,6 +795,11 @@ const handleDeleteGroup = async (group) => {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const resetToHomeView = () => {
|
||||
selectedFile.value = null;
|
||||
groupMarkdownFiles.value = []; // 清空笔记列表
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
BIN
mydatabase.db
BIN
mydatabase.db
Binary file not shown.
Reference in New Issue
Block a user