File tree Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @hoppscotch/ui" ,
3
- "version" : " 0.1.3 " ,
3
+ "version" : " 0.1.4 " ,
4
4
"license" : " MIT" ,
5
5
"description" : " Hoppscotch UI" ,
6
6
"author" :
" Hoppscotch ([email protected] )" ,
Original file line number Diff line number Diff line change 50
50
</template >
51
51
52
52
<script setup lang="ts" generic =" T extends any " >
53
- import { computed , inject } from " vue"
53
+ import { inject } from " vue"
54
54
import SmartTreeBranch from " ./TreeBranch.vue"
55
55
import SmartSpinner from " ./Spinner.vue"
56
56
import { SmartTreeAdapter , TreeNode } from " ~/helpers/treeAdapter"
@@ -68,5 +68,5 @@ const props = defineProps<{
68
68
/**
69
69
* Fetch the root nodes from the adapter by passing the node id as null
70
70
*/
71
- const rootNodes = computed (() => props .adapter .getChildren (null ). value )
71
+ const rootNodes = props .adapter .getChildren (null )
72
72
</script >
Original file line number Diff line number Diff line change 27
27
>
28
28
<SmartTreeBranch
29
29
v-for =" childNode in childNodes.data"
30
- :key =" childNode.id"
30
+ :key =" `${ childNode.id}-${childNode.data.type}` "
31
31
:node-item =" childNode"
32
32
:adapter =" adapter"
33
33
>
@@ -114,9 +114,7 @@ const highlightNode = ref(false)
114
114
/**
115
115
* Fetch the child nodes from the adapter by passing the node id of the current node
116
116
*/
117
- const childNodes = computed (
118
- () => props .adapter .getChildren (props .nodeItem .id ).value ,
119
- )
117
+ const childNodes = props .adapter .getChildren (props .nodeItem .id , props .nodeItem .data .type )
120
118
121
119
const toggleNodeChildren = () => {
122
120
if (! childrenRendered .value ) childrenRendered .value = true
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ export interface SmartTreeAdapter<T> {
28
28
/**
29
29
*
30
30
* @param nodeID - id of the node to get children for
31
+ * @param nodeType - Type of the node (`collection` | `request`)
31
32
* @returns - Ref that contains the children of the node. It is reactive and will be updated when the children are changed.
32
33
*/
33
- getChildren : ( nodeID : string | null ) => Ref < ChildrenResult < T > >
34
+ getChildren : ( nodeID : string | null , nodeType ?: string ) => Ref < ChildrenResult < T > >
34
35
}
You can’t perform that action at this time.
0 commit comments