refactor: 代码生成预览优化

This commit is contained in:
puhui999
2025-04-16 11:32:51 +08:00
parent 85a8fd5834
commit 09bf99b84c

View File

@@ -80,7 +80,13 @@ const handleNodeClick = (_: any[], e: any) => {
if (!e.node.isLeaf) return;
activeKey.value = e.node.key;
const file = previewFiles.value.find((item) => item.filePath === activeKey.value);
const file = previewFiles.value.find((item) => {
// 特殊处理
if (activeKey.value.includes('手动操作')) {
return item.filePath.includes('手动操作');
}
return item.filePath === activeKey.value;
});
if (!file) return;
const lang = file.filePath.split('.').pop() || '';