@@ -14,7 +14,7 @@ type Item = {
1414
1515const props = defineProps <{
1616 item: Item ,
17- navigateViewContent: (treePath : string , newTab : boolean ) => void ,
17+ navigateViewContent: (treePath : string , newTab ? : boolean ) => void ,
1818 loadChildren: (treePath : string , subPath ? : string ) => Promise <Item []>,
1919 selectedItem? : string ,
2020}>();
@@ -35,13 +35,17 @@ const doLoadChildren = async () => {
3535 }
3636};
3737
38- const doLoadDirContent = (newTab : boolean ) => {
39- if ( ! newTab ) doLoadChildren ();
40- props .navigateViewContent (props .item .fullPath , newTab );
38+ const doLoadDirContent = () => {
39+ doLoadChildren ();
40+ props .navigateViewContent (props .item .fullPath );
4141};
4242
43- const doLoadFileContent = (newTab : boolean ) => {
44- props .navigateViewContent (props .item .fullPath , newTab );
43+ const doLoadFileContent = () => {
44+ props .navigateViewContent (props .item .fullPath );
45+ };
46+
47+ const doOpenContentInNewTab = () => {
48+ props .navigateViewContent (props .item .fullPath , true );
4549};
4650
4751const doGotoSubModule = () => {
@@ -67,8 +71,8 @@ const doGotoSubModule = () => {
6771 v-else-if =" item.entryMode === 'symlink'" class =" tree-item type-symlink"
6872 :class =" {'selected': selectedItem === item.fullPath}"
6973 :title =" item.entryName"
70- @click.stop =" doLoadFileContent(false) "
71- @auxclick.stop =" doLoadFileContent(true) "
74+ @click.stop =" doLoadFileContent"
75+ @auxclick.stop =" doOpenContentInNewTab "
7276 >
7377 <!-- symlink -->
7478 <div class =" item-content" >
@@ -81,8 +85,8 @@ const doGotoSubModule = () => {
8185 v-else-if =" item.entryMode !== 'tree'" class =" tree-item type-file"
8286 :class =" {'selected': selectedItem === item.fullPath}"
8387 :title =" item.entryName"
84- @click.stop =" doLoadFileContent(false) "
85- @auxclick.stop =" doLoadFileContent(true) "
88+ @click.stop =" doLoadFileContent"
89+ @auxclick.stop =" doOpenContentInNewTab "
8690 >
8791 <!-- file -->
8892 <div class =" item-content" >
@@ -95,8 +99,8 @@ const doGotoSubModule = () => {
9599 v-else class =" tree-item type-directory"
96100 :class =" {'selected': selectedItem === item.fullPath}"
97101 :title =" item.entryName"
98- @click.stop =" doLoadDirContent(false) "
99- @auxclick.stop =" doLoadDirContent(true) "
102+ @click.stop =" doLoadDirContent"
103+ @auxclick.stop =" doOpenContentInNewTab "
100104 >
101105 <!-- directory -->
102106 <div class =" item-toggle" >
0 commit comments