You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-49
Original file line number
Diff line number
Diff line change
@@ -2,26 +2,26 @@
2
2
3
3
A light-weight library for management of hierachical content. Most solutions I found did not offer the depth of flexibility I needed with the tree. I decided to solve my problem and also give back to the Vue community. Feel free to log issues, I will jump on them at the slightest opportunity. 😊
4
4
5
-
## What it does.
5
+
## Features
6
6
7
7
1.:heavy_check_mark: Hierachical rendering of content.
8
8
2. ✔️ Subscribing to items checked event (based on type)
9
9
3.:heavy_check_mark: Moving Items between folders (drag-and-drop)
10
10
4.:heavy_check_mark: Customising Item Rendering based on item type
11
11
5. ✔️ Rendering selectable items like checkboxes or plain content
12
12
6. ✔️ Double clicking to rename item
13
-
7. Programmatically toggle item visibility based on the `type` property.
14
-
8. Sorting items alphametically or grouping based on types
15
-
9. Disabling and Enabling Item
16
-
10. Programmatically determining what item can be dragged into another item.
17
-
11. Custom Context Menu depending on item type.
18
13
19
-
## What it looks like.
14
+
## Features in Development
15
+
1. Programmatically toggle item visibility based on the `type` property.
16
+
2. Sorting items alphametically or grouping based on types
17
+
3. Disabling and Enabling Item(s)
18
+
4. Programmatically determining what item can be dragged into another item.
@@ -71,10 +71,9 @@ You can customise item based on their `type` property.
71
71
72
72
```
73
73
74
-
### Making Items Checkable Or Plain TreeView Item
75
-
76
-
`Tree-vue` supports 2-major types of tree items. Checkable items or plain items. You can set your preferences for a particular `type`. To do so listen to the createdEvent of the `tree-view` component.
74
+
## Advanced Customisation
77
75
76
+
The library provides a way to further customise the tree view by listening to the `v-on:created` event from the tree-view component. The payload surplied provides robust set of options for configuring the tree.
78
77
79
78
#### Schema of CreatedEvent Payload
80
79
@@ -86,7 +85,29 @@ You can customise item based on their `type` property.
Out-of-the-box, `v-tree-vue` ships with default behaviors like double clicking an item to rename, pushing the `DEL` key to delete and moving (drag-and-drop) items into new locations. However, this is totally customisable. The default command API exposes the following configurations:
192
-
193
-
```ts
194
-
exportinterfaceItemBehavior {
195
-
// Allow customisation of items that can be renamed on the tree.
196
-
enableRenaming(type:string):void;
197
-
// Allow customisation of items that can be deleted on the tree.
198
-
enableDeleting(type:string):void;
199
-
// Allow registration of handler to be called when an item of a particular type has been deleted.
## One Handler for all Types ? (We've got you covered).
212
-
213
-
In many cases and existing apps, a single handler is called whenever an item is renamed or deleted irrespective of it's type. This handler may then make an API call that takes care of the rest.
214
-
215
-
To do so when calling the `registerItemRenamedHandler` or `registerItemDeletedHandler` pass 'ANY_TYPE' as the `type` property. The `callback` will be called whenever ANY item is renamed or deleted.
216
-
217
-
```ts
218
-
import { ANY_TYPE } from'@/constants.ts';
219
-
```
220
-
221
-
> This avoids moving magic strings around and provides a central point of change in the future should the need arise. However, you can get rid of the extra import statement and use a string with value 'ANY_TYPE'.
0 commit comments