refactor: 代码生成预览文件节点点击事件特殊处理
This commit is contained in:
@@ -81,9 +81,11 @@ const handleNodeClick = (_: any[], e: any) => {
|
|||||||
|
|
||||||
activeKey.value = e.node.key;
|
activeKey.value = e.node.key;
|
||||||
const file = previewFiles.value.find((item) => {
|
const file = previewFiles.value.find((item) => {
|
||||||
// 特殊处理
|
const list = activeKey.value.split('.');
|
||||||
if (activeKey.value.includes('手动操作')) {
|
// 特殊处理-包合并
|
||||||
return item.filePath.includes('手动操作');
|
if (list.length > 2) {
|
||||||
|
const lang = list.pop();
|
||||||
|
return item.filePath === `${list.join('/')}.${lang}`;
|
||||||
}
|
}
|
||||||
return item.filePath === activeKey.value;
|
return item.filePath === activeKey.value;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user