chore: 更新.gitignore配置
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
:collapse="isCollapsed && !isMobile"
|
||||
popper-effect="light"
|
||||
:collapse-transition="true"
|
||||
@select="handleMenuSelect"
|
||||
>
|
||||
<div class="menu-section" v-if="isMobile">
|
||||
<div v-if="userStore.isLoggedIn" class="user-info">
|
||||
@@ -107,6 +108,24 @@ const goToTrash = () => router.push({ name: 'Trash' });
|
||||
const goToLogin = () => router.push('/login');
|
||||
const goToRegister = () => router.push('/register');
|
||||
|
||||
const handleMenuSelect = (index) => {
|
||||
if (index.startsWith('group-')) {
|
||||
const id = index.replace('group-', '');
|
||||
const findItem = (items) => {
|
||||
for (let item of items) {
|
||||
if (String(item.id) === id) return item;
|
||||
if (item.children) {
|
||||
const found = findItem(item.children);
|
||||
if (found) return found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const item = findItem(props.categoryTree);
|
||||
if (item) emit('select-file', item);
|
||||
}
|
||||
};
|
||||
|
||||
const handleDeleteGroup = (group) => {
|
||||
ElMessageBox.confirm(
|
||||
`确定要删除分类 “${group.grouping}” 吗?这将同时删除该分类下的所有子分类和笔记。`,
|
||||
@@ -145,18 +164,19 @@ const renderMenu = (item) => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
return h(ElSubMenu, {
|
||||
index: `group-${item.id}`,
|
||||
popperClass: props.isCollapsed ? 'hide-popper' : ''
|
||||
popperClass: props.isCollapsed ? 'hide-popper' : '',
|
||||
class: { 'is-active': props.activeMenu === `group-${item.id}` },
|
||||
disabled: false
|
||||
}, {
|
||||
title: () => h('div', {
|
||||
class: 'submenu-title-wrapper',
|
||||
onClick: () => emit('select-file', item),
|
||||
style: 'width: 100%; display: flex; align-items: center;'
|
||||
}, [ wrappedContent() ]),
|
||||
default: () => item.children.map(child => renderMenu(child))
|
||||
});
|
||||
}
|
||||
|
||||
return h(ElMenuItem, { index: `group-${item.id}`, onClick: () => emit('select-file', item) }, {
|
||||
return h(ElMenuItem, { index: `group-${item.id}` }, {
|
||||
default: wrappedContent
|
||||
});
|
||||
};
|
||||
@@ -349,6 +369,30 @@ const renderMenu = (item) => {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
/* 移除嵌套 SubMenu 的 active 样式 */
|
||||
:deep(.el-menu--inline .el-sub-menu.is-active > .el-sub-menu__title) {
|
||||
background: transparent !important;
|
||||
color: var(--text-color-secondary) !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
:deep(.el-menu--inline .el-sub-menu.is-active > .el-sub-menu__title::before) {
|
||||
height: 0 !important;
|
||||
}
|
||||
|
||||
/* 只有顶级 SubMenu 被直接选中时才显示 active 样式 */
|
||||
:deep(.el-menu > .el-sub-menu.is-active > .el-sub-menu__title) {
|
||||
background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-light) 100%) !important;
|
||||
color: #fff !important;
|
||||
font-weight: 600 !important;
|
||||
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.35) !important;
|
||||
}
|
||||
|
||||
:deep(.el-menu > .el-sub-menu.is-active > .el-sub-menu__title::before) {
|
||||
height: 24px !important;
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.el-menu-item:hover), :deep(.el-sub-menu__title:hover) {
|
||||
background-color: rgba(64, 158, 255, 0.08);
|
||||
color: var(--primary-color);
|
||||
|
||||
Reference in New Issue
Block a user