fix: 修复显示模式切换按钮无效问题(添加currentItems变量)
This commit is contained in:
@@ -1814,6 +1814,7 @@ INDEX_TEMPLATE = '''
|
||||
const API_BASE = '/api';
|
||||
let currentFilter = { type: '', status: '', starred: null, folder_id: null };
|
||||
let currentSort = { sort_by: '', sort_order: '' };
|
||||
let currentItems = []; // 保存当前显示的数据,用于切换显示模式时重新渲染
|
||||
let currentPage = 1;
|
||||
const pageSize = 20;
|
||||
let allFolders = {}; // 按类型存储文件夹
|
||||
@@ -2032,6 +2033,7 @@ async function loadItems(page = 1) {
|
||||
const data = await res.json();
|
||||
|
||||
if (data.success) {
|
||||
currentItems = data.data; // 保存数据用于切换显示模式
|
||||
renderItems(data.data);
|
||||
renderPagination(data.total, page); // 使用API返回的total
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user