click subpath
This commit is contained in:
@@ -481,8 +481,20 @@ function AnalyticsContent() {
|
||||
|
||||
// 处理子路径点击
|
||||
const handlePathClick = (path: string) => {
|
||||
console.log('Path clicked:', path);
|
||||
setSelectedSubpath(path);
|
||||
console.log('====== ANALYTICS PAGE PATH DEBUG ======');
|
||||
console.log('Original path:', path);
|
||||
|
||||
// 从路径中提取 subpath 部分,移除前导斜杠
|
||||
// 示例:如果路径是 "/slug/subpath",我们需要提取 "subpath" 部分
|
||||
// 或者直接使用原始路径,取决于您的路径结构
|
||||
const pathParts = path.split('/').filter(Boolean);
|
||||
// 如果路径包含多个部分,获取第二部分(subpath)
|
||||
const subpath = pathParts.length > 1 ? pathParts[1] : path;
|
||||
|
||||
console.log('Extracted subpath:', subpath);
|
||||
console.log('=====================================');
|
||||
|
||||
setSelectedSubpath(subpath);
|
||||
// 重置到第一页
|
||||
setCurrentPage(1);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user