Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-12-18 23:51:08 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a4aa5605a4669f395f396c3a828cc58a0f8a4913
a4aa5605
1 parent
3e5e6005
perf(打卡页面): 使用splice替代filter优化删除性能
style(日历组件): 修正缩进格式
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
src/components/ui/CollapsibleCalendar.vue
src/views/checkin/IndexCheckInPage.vue
src/components/ui/CollapsibleCalendar.vue
View file @
a4aa560
<!--
* @Date: 2025-01-25 15:34:17
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-18 23:
38:02
* @LastEditTime: 2025-12-18 23:
45:18
* @FilePath: /mlaj/src/components/ui/CollapsibleCalendar.vue
* @Description: 可折叠日历组件
-->
...
...
@@ -208,7 +208,7 @@ watch(y, (newY) => {
// 只有当向上滚动超过一定距离或者不在底部反弹区域时才显示
// 这里的判断其实已经被上面的触底检测覆盖了一部分,但为了保险,可以加一个最小变动阈值
if (Math.abs(newY - lastY.value) > 5) {
isHeaderHidden.value = false
isHeaderHidden.value = false
}
}
...
...
src/views/checkin/IndexCheckInPage.vue
View file @
a4aa560
<!--
* @Date: 2025-05-29 15:34:17
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-18 2
2:58:48
* @LastEditTime: 2025-12-18 2
3:48:47
* @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue
* @Description: 文件描述
-->
...
...
@@ -517,9 +517,14 @@ const delCheckin = (post) => {
if (code) {
// 删除成功后,刷新页面
showSuccessToast('删除成功');
// router.go(0);
// 删除post_id相应的数据
checkinDataList.value = checkinDataList.value.filter(item => item.id !== post.id);
// 优化:使用 splice 替代 filter,避免大数组重新分配内存,性能更好
// checkinDataList.value = checkinDataList.value.filter(item => item.id !== post.id);
const index = checkinDataList.value.findIndex(item => item.id === post.id);
if (index > -1) {
checkinDataList.value.splice(index, 1);
}
// 检查是否还可以打卡
const current_date = route.query.date;
if (current_date) {
...
...
Please
register
or
login
to post a comment