feat: 个人资料编辑页+分类折叠展开
- 新增个人资料页(昵称修改+密码修改) - 后端 PUT /api/admin/password 接口 - 侧边栏新增个人资料菜单项 - 前台分类增加折叠/展开交互 - Profile页+路由注册
This commit is contained in:
@@ -34,8 +34,11 @@
|
||||
<span class="icon">{{ cat.icon }}</span>
|
||||
<span class="name">{{ cat.name }}</span>
|
||||
<span class="count">{{ linksInCat(cat.id).length }}</span>
|
||||
<span class="collapse-btn" @click="toggleCat(cat.id)">
|
||||
{{ collapsedCats.has(cat.id) ? '展开' : '收起' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="links-grid">
|
||||
<div v-show="!collapsedCats.has(cat.id)" class="links-grid">
|
||||
<a
|
||||
v-for="link in linksInCat(cat.id)"
|
||||
:key="link.id"
|
||||
@@ -79,6 +82,13 @@ const data = reactive({ categories: [] as any[], settings: {} as any, links: []
|
||||
const search = ref('')
|
||||
const filteredLinks = ref<any[]>([])
|
||||
const searchTimer = ref<ReturnType<typeof setTimeout>>()
|
||||
const collapsedCats = ref<Set<number>>(new Set())
|
||||
|
||||
function toggleCat(id: number) {
|
||||
const s = new Set(collapsedCats.value)
|
||||
if (s.has(id)) s.delete(id); else s.add(id)
|
||||
collapsedCats.value = s
|
||||
}
|
||||
|
||||
const filteredCategories = computed(() => {
|
||||
return data.categories.filter((cat: any) =>
|
||||
@@ -213,6 +223,16 @@ loadData()
|
||||
padding: 2px 10px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.collapse-btn {
|
||||
margin-left: auto;
|
||||
font-size: 12px;
|
||||
color: #6366f1;
|
||||
cursor: pointer;
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
user-select: none;
|
||||
}
|
||||
.collapse-btn:hover { background: rgba(99,102,241,0.1); }
|
||||
}
|
||||
|
||||
.links-grid {
|
||||
|
||||
Reference in New Issue
Block a user