Skip to content

VTreeDrop API

VTreeDrop Props

Note: You can use all the props of VTree and VTreeSearch in VTreeDrop

PropDescriptionTypeDefault Value
dropHeightHeight of the dropdownnumber300
dropPlaceholderPlaceholder of display inputstringNone
dropDisabledWhether to disable tree dropbooleanfalse
clearableAllow to clearbooleanfalse
placementThe position of the dropdown. Note!! Does not support auto adapting directions'bottom-start' | 'bottom-end' | 'bottom' | 'top-start' | 'top-end' | 'top''bottom-start'
transferTo transfer DOM to bodybooleanfalse
dropdownClassNameExtra class on dropdown containerstring | string[]None
dropdownMinWidth 2.0.1Min width of the dropdown. The default width is the width of the display input. It's better to use when 'transfer' is falsenumberNone
dropdownWidthFixed 2.0.5Fix the width of the dropdown. When the content length exceeds the min with of the dropdown, a horizontal scrollbar appearsbooleanfalse

VTreeDrop Events

Note: You can listen to all the events of VTree and VTreeSearch on VTreeDrop

EventDescriptionReturn Value
dropdown-visible-changeTriggers when dropdown shows/hidesVisibility of the dropdown
clearTriggers when click on the clear buttonNone

VTreeDrop Methods

Note: You can use all the methods of VTree and VTreeSearch in VTreeDrop

VTreeDrop Slots

Note: You can pass all the slots of VTree and VTreeSearch to VTreeDrop

NameDescription
defaultThe whole input
displayThe text of display input. Not effective when the default slot is present
clearTo replace the clear icon. Not effective when the default slot is present

Slot props of default and display slots 2.3.0:

typescript
/** Slot props of display */
slotProps: {
  /** Multiple selected nodes */
  checkedNodes: [] as TreeNode[],

  /** Multiple selected node keys */
  checkedKeys: [] as Array<string | number>,

  /** Single selected nodes */
  selectedNode: null as TreeNode | null,

  /** Single selected node keys */
  selectedKey: null as string | number | null,
},

Note: checkedNodes and selectedNode only include loaded nodes. The content of these two fields will be empty if value prop is set but there's no tree data; While checkedKeys and selectedKey contains node keys that is not yet loaded.