@@ -43,10 +43,80 @@ vue-grid-layout is a grid layout system, like [Gridster](http://gridster.net), f
4343
4444## Installation
4545
46+ Install the vue-grid-layout [ package] ( https://www.npmjs.org/package/vue-grid-layout ) package using [ npm] ( https://www.npmjs.com/ ) :
47+
48+ npm install react-grid-layout
4649
4750
4851## Usage
4952
53+ npm install react-grid-layout
54+
55+ ``` javascript
56+
57+ var testLayout = [
58+ {" x" : 0 ," y" : 0 ," w" : 2 ," h" : 2 ," i" : " 0" },
59+ {" x" : 2 ," y" : 0 ," w" : 2 ," h" : 4 ," i" : " 1" },
60+ {" x" : 4 ," y" : 0 ," w" : 2 ," h" : 5 ," i" : " 2" },
61+ {" x" : 6 ," y" : 0 ," w" : 2 ," h" : 3 ," i" : " 3" },
62+ {" x" : 8 ," y" : 0 ," w" : 2 ," h" : 3 ," i" : " 4" },
63+ {" x" : 10 ," y" : 0 ," w" : 2 ," h" : 3 ," i" : " 5" },
64+ {" x" : 0 ," y" : 5 ," w" : 2 ," h" : 5 ," i" : " 6" },
65+ {" x" : 2 ," y" : 5 ," w" : 2 ," h" : 5 ," i" : " 7" },
66+ {" x" : 4 ," y" : 5 ," w" : 2 ," h" : 5 ," i" : " 8" },
67+ {" x" : 6 ," y" : 4 ," w" : 2 ," h" : 4 ," i" : " 9" },
68+ {" x" : 8 ," y" : 4 ," w" : 2 ," h" : 4 ," i" : " 10" },
69+ {" x" : 10 ," y" : 4 ," w" : 2 ," h" : 4 ," i" : " 11" },
70+ {" x" : 0 ," y" : 10 ," w" : 2 ," h" : 5 ," i" : " 12" },
71+ {" x" : 2 ," y" : 10 ," w" : 2 ," h" : 5 ," i" : " 13" },
72+ {" x" : 4 ," y" : 8 ," w" : 2 ," h" : 4 ," i" : " 14" },
73+ {" x" : 6 ," y" : 8 ," w" : 2 ," h" : 4 ," i" : " 15" },
74+ {" x" : 8 ," y" : 10 ," w" : 2 ," h" : 5 ," i" : " 16" },
75+ {" x" : 10 ," y" : 4 ," w" : 2 ," h" : 2 ," i" : " 17" },
76+ {" x" : 0 ," y" : 9 ," w" : 2 ," h" : 3 ," i" : " 18" },
77+ {" x" : 2 ," y" : 6 ," w" : 2 ," h" : 2 ," i" : " 19" }
78+ ];
79+
80+ var GridLayout = VueGridLayout .GridLayout ;
81+ var GridItem = VueGridLayout .GridItem ;
82+
83+ new Vue ({
84+ el: ' #app' ,
85+ components: {
86+ GridLayout,
87+ GridItem,
88+ },
89+ data: {
90+ layout: testLayout,
91+ },
92+ });
93+ ````
94+
95+
96+ ` ` ` ` html
97+
98+ < grid- layout
99+ : layout .sync = " layout"
100+ : col- num= " 12"
101+ : row- height= " 30"
102+ : is- draggable= " true"
103+ : is- resizable= " true"
104+ : vertical- compact= " true"
105+ : margin= " [10, 10]"
106+ : use- css- transforms= " true"
107+ >
108+
109+ < grid- item v- for = " item in layout"
110+ : x .sync = " item.x"
111+ : y .sync = " item.y"
112+ : w .sync = " item.w"
113+ : h .sync = " item.h"
114+ : i= " item.i" >
115+ {{item .i }}
116+ < / grid- item>
117+ < / grid- layout>
118+ ````
119+
50120
51121## Contribute
52122
0 commit comments