Merge folder and node impl

This commit is contained in:
huchenlei
2024-08-31 18:23:20 -04:00
committed by Chenlei Hu
parent 488f0d82b4
commit 280b43fd58
4 changed files with 64 additions and 97 deletions

View File

@@ -1,5 +1,3 @@
import { Ref } from 'vue'
export interface TreeExplorerNode<T = any> {
key: string
label: string
@@ -8,6 +6,8 @@ export interface TreeExplorerNode<T = any> {
children?: TreeExplorerNode<T>[]
icon?: string
getIcon?: (node: TreeExplorerNode<T>) => string
// Function to handle renaming the node
handleRename?: (node: TreeExplorerNode<T>, newName: string) => void
}
export interface RenderedTreeExplorerNode<T = any> extends TreeExplorerNode<T> {
@@ -22,10 +22,3 @@ export type TreeExplorerDragAndDropData<T = any> = {
type: 'tree-explorer-node'
data: RenderedTreeExplorerNode<T>
}
export interface TreeExplorerNodeSlotProps {
node: RenderedTreeExplorerNode
handleItemDropped: (node: RenderedTreeExplorerNode) => void
renameEditingNode: Ref<RenderedTreeExplorerNode | null>
handleRename: (node: RenderedTreeExplorerNode, newName: string) => void
}