radio-treeselect
v0.1.9
Published
[![npm](https://badgen.now.sh/npm/v/vue3-treeselect)](https://www.npmjs.com/package/vue3-treeselect) [![Coverage](https://badgen.net/codecov/c/github/megafetis/vue3-treeselect)](https://codecov.io/gh/megafetis/vue3-treeselect?branch=main) ![npm monthly d
Downloads
12
Readme
radio-treeselect
A multi-select component with nested options support for Vue 3 with signle select radio button. Thank to megafetis and his sources and library for vue 2 taken as basis.
Features
- Single & multiple select with nested options support
- Fuzzy matching
- Async searching
- Delayed loading (load data of deep level options only when needed)
- Keyboard support (navigate using Arrow Up & Arrow Down keys, select option using Enter key, etc.)
- Rich options & highly customizable
- Supports a wide range of browsers (see below)
- RTL support
Requires Vue 3.2.0+
Demo
https://codesandbox.io/s/thirsty-elgamal-wj2pw6?file=/src/App.vue
Getting Started
It's recommended to install radio-treeselect via npm, and build your app using a bundler like webpack.
npm install radio-treeselect
This example shows how to integrate radio-treeselect with your Vue SFCs.
<!-- Vue SFC -->
<script>
// import the component
import RadioTreeSelect from 'radio-treeselect'
// import the styles
import "radio-treeselect/dist/radio-treeselect.css";
const options = [
{
id: "a",
label: "In linguistics and grammar, a sentence is a linguistic expression, such as the English example `The quick brown fox jumps over the lazy dog.` In traditional grammar it is typically defined as a string of words that expresses a complete thought",
children: [
{
id: "aa",
label: "Wikitext redirects here. For the Wikipedia help page,",
children: [
{
id: "aaa",
label: "Some wikis keep a record of changes made to wiki pages; often, every version of the page is stored.",
},
{
id: "abb",
label: "abb",
},
],
},
{
id: "ab",
label: "ab",
},
],
},
{
id: "b",
label: "b",
},
{
id: "c",
label: "c",
},
{
id: "d",
label: "d",
children: [
{
id: "test",
label: "test",
},
{
id: "abc",
label: "abc",
},
],
},
{
id: "e",
label: "e",
children: [
{
id: "f",
label: "f",
},
{
id: "g",
label: "g",
},
],
},
]
export default {
components: {
RadioTreeSelect,
},
data: function () {
return {
options: options
};
},
};
</script>
<template>
<RadioTreeSelect :isMultiple="true" :options="options" :confirmButton="true" breadCrumbSymbol=" >> "/>
</template>
Documentation for vue 2 & Live Demo. Be careful with breaking changes above.
Note: please use a desktop browser since the website hasn't been optimized for mobile devices.
Browser Compatibility
- Chrome
- Edge
- Firefox
- Safari
It should function well on IE9, but the style can be slightly broken due to the lack of support of some relatively new CSS features, such as transition
and animation
. Nevertheless it should look 90% same as on modern browsers.
Bugs
Contributing
- Fork & clone the repo
- Install dependencies by
yarn
ornpm install
- Check out a new branch
npm run dev
& hack- Make sure
npm test
passes - Push your changes & file a pull request
Credits
This project is inspired by vue3-treeselect. Special thanks go to their respective authors!
Some icons used in this project:
- "link" icon made by Smashicons is licensed under CC 3.0 BY
- "spinner" icon from SpinKit is licensed under the MIT License
- "caret" icon made by Dave Gandy is licensed under CC 3.0 BY
- "delete" icon made by Freepik is licensed under CC 3.0 BY
- "checkmark symbol" & "minus symbol" icons made by Catalin Fertu are licensed under CC 3.0 BY
License
Released under the MIT License.