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
+48-31
Original file line number
Diff line number
Diff line change
@@ -15,24 +15,25 @@ There is an [issue](https://github.com/eidng8/vue-tree/issues/24) for this. Chec
15
15
16
16
## Props
17
17
18
-
| Prop name | Description | Type | Default |
19
-
| --- | --- | :-: | :-: |
20
-
| item-id | Key of the field in `item` to be used as element's `id` attribute. | string | 'id' |
21
-
| item-label | Key of the field in `item` that holds node label. | string | 'name' |
22
-
| tags-key | Key of the field in `item` that holds tags array. | string | 'tags' |
23
-
| children-key | Key of the field in `item` that holds child nodes array. | string | 'children' |
24
-
| tag-id | Key of the field in tags list of `item` to be used as tag element's `id` attribute. | string | 'id' |
25
-
| tag-label | Key of the field in tags list of `item` that holds tag label. | string | 'label' |
26
-
| tag-hint | Key of the field in tags list of `item` that holds tag tooltip. | string | 'hint' |
27
-
| checker | Whether to add a checkbox before each item,<br>allowing multiple nodes tobe checked. | boolean | false |
28
-
| item | The tree data to be rendered.<br>Please note that data passed **_may_** be mutated by this<br>component to reflect various states of tree nodes.<br>Mutated fields include:<br>- checked<br>- intermediate<br>- rendered |[G8TreeItem](#g8treeitem)||
| item-id | Key of the field in `item` to be used as element's `id` attribute. | string | 'id' |
22
+
| item-label | Key of the field in `item` that holds node label. | string | 'name' |
23
+
| tags-key | Key of the field in `item` that holds tags array. | string | 'tags' |
24
+
| children-key | Key of the field in `item` that holds child nodes array. | string | 'children' |
25
+
| tag-id | Key of the field in tags list of `item` to be used as tag element's `id` attribute. | string | 'id' |
26
+
| tag-label | Key of the field in tags list of `item` that holds tag label. | string | 'label' |
27
+
| tag-hint | Key of the field in tags list of `item` that holds tag tooltip. | string | 'hint' |
28
+
| checker | Whether to add a checkbox before each item,<br>allowing multiple nodes tobe checked. | boolean | false |
29
+
| item | The tree data to be rendered.<br>Please note that data passed **_may_** be mutated by this<br>component to reflect various states of tree nodes.<br>Mutated fields include:<br>- checked<br>- intermediate<br>- rendered |[G8TreeItem](#g8treeitem)||
29
30
30
31
## Scoped slots
31
32
32
33
#### Default slot
33
34
34
35
```vue
35
-
<span class="g8-tree__node_entry_label">
36
+
<span class="g8-tree__node__entry__label">
36
37
<slot :item="item">{{ item[itemLabel] }}</slot>
37
38
</span>
38
39
```
@@ -43,7 +44,7 @@ This is the entry's main content slot. Defaults to `{{ item[itemLabel] }}`. The
43
44
44
45
```vue
45
46
<label
46
-
class="g8-tree__node_entry_tags_tag"
47
+
class="g8-tree__node__entry__tags__tag"
47
48
v-for="(tag, idx) in item[tagsKey]"
48
49
:key="idx"
49
50
:id="tag[tagId]"
@@ -61,19 +62,21 @@ This is the entry's tag content slot. Defaults to `{{ tag[tagLabel] }}`. The cur
61
62
62
63
Below is a list of presumable fields, all of them are optional. You can place whatever data you want to a tree item, then use the [props](#props) mentioned above to specify content you want to display.
63
64
64
-
| Field name | Type | Description |
65
-
| --- | :-: | --- |
66
-
| name | string | Item name, serves as label, will be rendered as node label. |
67
-
| checked | boolean | Whether the node is checked. |
68
-
| intermediate | boolean | Intermediate check box state. Active while some children were checked. |
69
-
| rendered | boolean | Whether the sub-tree of this node has been rendered. |
70
-
| tags |[G8TreeItemTag](#g8treeitemtag)\[]| List of tags. |
71
-
| children |[G8TreeItem](#g8treeitem)\[]| List of child nodes. |
| name | string | Item name, serves as label, will be rendered as node label. |
69
+
| checked | boolean | Whether the node is checked. |
70
+
| intermediate | boolean | Intermediate check box state. Active while some children were checked. |
71
+
| rendered | boolean | Whether the sub-tree of this node has been rendered. |
72
+
| tags |[G8TreeItemTag](#g8treeitemtag)\[]| List of tags. |
73
+
| children |[G8TreeItem](#g8treeitem)\[]| List of child nodes. |
72
74
73
75
#### G8TreeItemTag
74
76
75
77
Below is a list of presumable fields, all of them are optional. You can place whatever data you want to tags, then use the [props](#props) mentioned above to specify content you want to display.
| click |[G8ClickEvent](#g8clickevent)| A tree node has been clicked. Use the `data.expanded` to determine if the node were expanded (`true`). |
102
+
| state-changed |[G8TreeItem](#g8treeitem)| Checkbox state of the node has changed. |
98
103
99
104
#### Other events
100
105
101
106
## Theming
102
107
103
-
The bundled style sheet can be imported from `'g8-vue-tree/dist/g8-vue-tree.css'`. This component provides a dark theme out of box. To use it, just add the `g8-tree__dark` class to the element.
108
+
#### Colors
109
+
110
+
The bundled style sheet can be imported from `'g8-vue-tree/dist/g8-vue-tree.css'`. This component provides a dark theme out of box. To use it, just add the `g8-tree--dark` class to the element.
104
111
105
112
```html
106
-
<ulclass="g8-tree-view g8-tree__dark">
107
-
<g8-tree-view></g8-tree-view>
113
+
<ulclass="g8-tree__view g8-tree--dark">
114
+
<g8-tree__view></g8-tree__view>
108
115
</ul>
109
116
```
110
117
@@ -119,3 +126,13 @@ $g8-tree-fg: #333;
119
126
120
127
@import'~vue-tree/src/components/tree-view.scss';
121
128
```
129
+
130
+
#### Fonts
131
+
132
+
This component deliberately left out `font-family` from CSS. You can use whatever font you like, just add something like below to you styles:
0 commit comments