Skip to content

Commit 2ef8529

Browse files
committed
update readme
1 parent d36f4d0 commit 2ef8529

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# gridjs-vue
22

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>
44

55
A Vue wrapper component for [Grid.js](https://gridjs.io).
66

@@ -124,6 +124,18 @@ Refer to [Grid.js documentation](https://gridjs.io/docs/config/) for specific co
124124
// An array containing strings of column headers (`columns` in the Grid.js API)
125125
cols: ['col 1', 'col 2'],
126126
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+
127139
// AND EITHER an array containing row data (`data` in the Grid.js API)
128140
rows: [
129141
['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
132144
133145
// OR an array containing JSON row data
134146
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' }
137149
]
138150
139151
// OR a function returning an array of row data
140152
rows() {
141153
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 }
144156
]
145157
}
146158

0 commit comments

Comments
 (0)