Vue 3 wrapper around treeselectjs providing a multi-select component with nested options. Version 0.9.2, stable, TypeScript types included. Supports keyboard navigation, screen-sensitive direction, multiple selection, and slots for customization. Key differentiator is its lightweight bundle (4.6 kB JS, 8.5 kB CSS) and full TypeScript support. The component is designed for tree-like data structures (e.g., categories with children) and offers both v-model two-way binding and event-driven usage.
npm install vue-treeselectjsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage with v-model, nested options, and multiple selection in a Vue 3 composition API component with TypeScript.
Ensure each option object includes a 'value' field (string, number, or boolean). Tree structure uses 'children' array.
Use @update:modelValue instead of @input when using non-v-model binding.
Update any code that relies on Treeselect being a functional component (e.g., accessing component internals).
Access via window.VueTreeselect in script tags.
Replace 'multiple' with 'multiselect' prop.
Import the CSS file in your main entry point or component that uses Treeselect.
Run 'npm install --save vue-treeselectjs' and use import 'vue-treeselectjs' (not a subpath).
Ensure you have bound a valid reactive value and used 'v-model="yourVar"'. If customizing, use ':model-value' and '@update:modelValue' explicitly.
Pass an array of objects with at least 'name' and 'value' properties. Use 'children' array for nested levels.
Use default import: import Treeselect from 'vue-treeselectjs'. Do not use destructuring braces for the default export.
Make sure you are using Vue 3 (the component is for Vue 3 only).