Skip to content

Commit 54fcf67

Browse files
committed
Merge branch 'master' of https://github.com/euvl/vue-js-grid
2 parents e2cd409 + 69bacb1 commit 54fcf67

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
## Vue.js Grid
22

3+
[![npm version](https://badge.fury.io/js/vue-js-grid.svg)](https://badge.fury.io/js/vue-js-grid)
4+
[![npm](https://img.shields.io/npm/dm/vue-js-grid.svg)](https://www.npmjs.com/package/vue-js-grid)
5+
36
#### Fixed size grid for Vue.js
47

58
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! 👍 🚀
69

710
Thanks!
811

12+
<p align="center">
13+
<img src="https://user-images.githubusercontent.com/1577802/30805846-45ccd718-a1eb-11e7-9963-7aee8e76c9b0.gif">
14+
</p>
15+
916
### Install
1017
```
1118
npm install --save vue-js-grid
@@ -44,26 +51,32 @@ data () {
4451
</grid>
4552
```
4653
54+
Plugin does **NOT** modify the source data array.
55+
56+
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+
4760
### Props
4861
4962
| Name | Type | Default | Description |
5063
| --- | --- | --- | --- |
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 |
5568
| 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` |
5770
| center | Boolean | false | @TODO |
5871
5972
### Events
6073
6174
| Name | Description |
6275
| --- | --- |
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 |
6780
6881
### Cell template
6982
@@ -89,6 +102,12 @@ Example:
89102
</template>
90103
```
91104
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.
108+
109+
Demo: https://euvl.github.io/vue-js-grid/
110+
92111
### Roadmap
93112
94113
1. Add element insertion

0 commit comments

Comments
 (0)