refactor: 代码生成预览文件节点点击事件特殊处理

This commit is contained in:
puhui999
2025-04-16 18:05:24 +08:00
parent ab67eb049e
commit 9f18215c36

View File

@@ -81,9 +81,11 @@ const handleNodeClick = (_: any[], e: any) => {
activeKey.value = e.node.key;
const file = previewFiles.value.find((item) => {
// 特殊处理
if (activeKey.value.includes('手动操作')) {
return item.filePath.includes('手动操作');
const list = activeKey.value.split('.');
// 特殊处理-包合并
if (list.length > 2) {
const lang = list.pop();
return item.filePath === `${list.join('/')}.${lang}`;
}
return item.filePath === activeKey.value;
});