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 11{
22 "name" : " @hoppscotch/ui" ,
3- "version" : " 0.1.3 " ,
3+ "version" : " 0.1.4 " ,
44 "license" : " MIT" ,
55 "description" : " Hoppscotch UI" ,
66 "author" :
" Hoppscotch ([email protected] )" ,
Original file line number Diff line number Diff line change 5050</template >
5151
5252<script setup lang="ts" generic =" T extends any " >
53- import { computed , inject } from " vue"
53+ import { inject } from " vue"
5454import SmartTreeBranch from " ./TreeBranch.vue"
5555import SmartSpinner from " ./Spinner.vue"
5656import { SmartTreeAdapter , TreeNode } from " ~/helpers/treeAdapter"
@@ -68,5 +68,5 @@ const props = defineProps<{
6868/**
6969 * Fetch the root nodes from the adapter by passing the node id as null
7070 */
71- const rootNodes = computed (() => props .adapter .getChildren (null ). value )
71+ const rootNodes = props .adapter .getChildren (null )
7272 </script >
Original file line number Diff line number Diff line change 2727 >
2828 <SmartTreeBranch
2929 v-for =" childNode in childNodes.data"
30- :key =" childNode.id"
30+ :key =" `${ childNode.id}-${childNode.data.type}` "
3131 :node-item =" childNode"
3232 :adapter =" adapter"
3333 >
@@ -114,9 +114,7 @@ const highlightNode = ref(false)
114114/**
115115 * Fetch the child nodes from the adapter by passing the node id of the current node
116116 */
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 )
120118
121119const toggleNodeChildren = () => {
122120 if (! childrenRendered .value ) childrenRendered .value = true
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ export interface SmartTreeAdapter<T> {
2828 /**
2929 *
3030 * @param nodeID - id of the node to get children for
31+ * @param nodeType - Type of the node (`collection` | `request`)
3132 * @returns - Ref that contains the children of the node. It is reactive and will be updated when the children are changed.
3233 */
33- getChildren : ( nodeID : string | null ) => Ref < ChildrenResult < T > >
34+ getChildren : ( nodeID : string | null , nodeType ?: string ) => Ref < ChildrenResult < T > >
3435}
You can’t perform that action at this time.
0 commit comments