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
This is very a first version of the plugin. If you find any bugs and/or want to contribute, feel free to create issues, PRs or reach me out on twitter! 👍 🚀
1. Every time permutation is performed you will get a new sorted array in event (`items`).
57
+
2. The same works for removing elements, you will get a new "cleaned" array in your `@remove` event handler.
58
+
3. Currently there is no way to extend data array after event handling. But hopefully I'll come up with a clean way to do it in nearest future.
59
+
47
60
### Props
48
61
49
62
| Name | Type | Default | Description |
50
63
| --- | --- | --- | --- |
51
-
| items | [Object] | [] | |
52
-
| cellWidth | Number | 80 | |
53
-
| cellHeight | Number | 80 | |
54
-
| draggable | Boolean | false | |
64
+
| items | Array | [] | Initial array of items |
65
+
| cellWidth | Number | 80 | Cell width |
66
+
| cellHeight | Number | 80 | Cell height |
67
+
| draggable | Boolean | false | Flag that will let you drag grid's cells |
55
68
| dragDelay | Number | 0 | @TODO |
56
-
| sortable | Boolean | false | |
69
+
| sortable | Boolean | false | Flag that will let you reorder grid's cells, requires `draggable` to be `true`|
57
70
| center | Boolean | false | @TODO |
58
71
59
72
### Events
60
73
61
74
| Name | Description |
62
75
| --- | --- |
63
-
| @change | |
64
-
| @remove | |
65
-
| @click | |
66
-
| @sort | |
76
+
| @change | Occurs on every action that involves reordering array or changing it's length |
77
+
| @remove | Occurs when an element is deleted through template |
78
+
| @click | Occurs when cell is clicked |
79
+
| @sort | Occurs when array item order is changed manually |
67
80
68
81
### Cell template
69
82
@@ -89,6 +102,12 @@ Example:
89
102
</template>
90
103
```
91
104
105
+
### Why do i need this?
106
+
107
+
A good example of using a plugin would be rending macOS' `Launchpad` or `Dock`. Check out a demo for a solid example of how the plugin behaves & feels.
0 commit comments