refactor: 代码生成预览优化

pull/75/head
puhui999 2025-04-16 11:32:51 +08:00
parent 85a8fd5834
commit 09bf99b84c
1 changed files with 7 additions and 1 deletions

View File

@ -80,7 +80,13 @@ const handleNodeClick = (_: any[], e: any) => {
if (!e.node.isLeaf) return; if (!e.node.isLeaf) return;
activeKey.value = e.node.key; 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; if (!file) return;
const lang = file.filePath.split('.').pop() || ''; const lang = file.filePath.split('.').pop() || '';