1
1
# gridjs-vue
2
2
3
- <center ><img src =" https://user-images.githubusercontent.com/2541728/84843482-ffc31c00-b015-11ea-95e8-dc6fb3931ad5.png " alt =" gridjs-vue logo " /></center >
3
+ <div style = " max-width : 50 % ; width : 100 % ; margin : 0 auto ; " ><img src =" https://user-images.githubusercontent.com/2541728/84843482-ffc31c00-b015-11ea-95e8-dc6fb3931ad5.png " alt =" gridjs-vue logo " /></div >
4
4
5
5
A Vue wrapper component for [ Grid.js] ( https://gridjs.io ) .
6
6
@@ -124,6 +124,18 @@ Refer to [Grid.js documentation](https://gridjs.io/docs/config/) for specific co
124
124
// An array containing strings of column headers (`columns` in the Grid.js API)
125
125
cols: [' col 1' , ' col 2' ],
126
126
127
+ // OR an array containing objects defining column headers
128
+ cols: [
129
+ {
130
+ name: ' Column 1' ,
131
+ id: ' col1'
132
+ },
133
+ {
134
+ name: ' Column 2' ,
135
+ id: ' col2'
136
+ }
137
+ ]
138
+
127
139
// AND EITHER an array containing row data (`data` in the Grid.js API)
128
140
rows: [
129
141
[' row 1 col 1' , ' row 1 col 2' ],
@@ -132,15 +144,15 @@ Refer to [Grid.js documentation](https://gridjs.io/docs/config/) for specific co
132
144
133
145
// OR an array containing JSON row data
134
146
rows: [
135
- { ' col 1 ' : ' row 1' , ' col 2 ' : ' row 1' },
136
- { ' col 1 ' : ' row 2' , ' col 2 ' : ' row 2' }
147
+ { col1 : ' row 1' , col2 : ' row 1' },
148
+ { col1 : ' row 2' , col2 : ' row 2' }
137
149
]
138
150
139
151
// OR a function returning an array of row data
140
152
rows () {
141
153
return [
142
- { ' col 1 ' : 3 + 4 , ' col 2 ' : 5 + 6 },
143
- { ' col 1 ' : 1 * 2 , ' col 2 ' : 7 * 8 }
154
+ { col1 : 3 + 4 , col2 : 5 + 6 },
155
+ { col1 : 1 * 2 , col2 : 7 * 8 }
144
156
]
145
157
}
146
158
0 commit comments