DEV Community

Cover image for Vue-Select and Vue-Treeselect never got a stable Vue 3 release, so we replaced them
Syazwan
Syazwan

Posted on

Vue-Select and Vue-Treeselect never got a stable Vue 3 release, so we replaced them

We're moving a large app from Vue 2.7 to Vue 3. Most of it ports over fine. The dropdowns didn't.

The app uses vue-select and vue-treeselect all over the place. vue-select only supports Vue 3 through its 4.0 beta, and the last beta came out in November 2022. vue-treeselect's last release was in October 2019, and it only runs on Vue 2. Neither one could come with us.

There are Vue 3 forks of both, but they're Vue 3 only. We'd still be running the old libraries on 2.7 until the day we switch, then replacing every dropdown at once.

So I wrote Vue Pick, one component that runs on both Vue 2.7 and Vue 3 with the same props. We can replace the old selects now, while still on 2.7, and they keep working after we switch to 3. The only change at that point is the import path, vue-pick/vue2 to vue-pick.

It covers what we used those two libraries for: search, multiselect, and tree select with parent and child checkboxes, including loading children from the server. It has no runtime dependencies. Vue is the only thing it needs.

If you're stuck on the same two libraries, it might save you some time.

https://vue-pick.js.org
https://github.com/syazwanz/vue-pick

Top comments (0)