Skip to content

Commit a479420

Browse files
committed
fix update api + scoped css
1 parent ac4e846 commit a479420

23 files changed

+8084
-615
lines changed

README.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ Refer to [Grid.js documentation](https://gridjs.io/docs/config/) for specific co
4747
<template>
4848
<grid
4949
:auto-width="autoWidth"
50-
:data="data"
50+
:columns="cols"
5151
:from="from"
5252
:language="language"
5353
:pagination="pagination"
54+
:rows="rows"
5455
:search="search"
5556
:server="server"
5657
:sort="sort"
@@ -69,14 +70,11 @@ export default {
6970
data() {
7071
return {
7172
autoWidth: true / false, // boolean to automatically set table width
72-
data: {
73-
// object containing arrays of columns & rows
74-
cols: ['column 1', 'column 2'],
75-
rows: ['row 1: col 1', 'row 1: col 2']
76-
},
73+
cols: ['column 1', 'column 2'], // array containing strings of column headers
7774
from: '.my-element', // string of HTML table selector
7875
language: {}, // localization dictionary object
7976
pagination: true / false || {}, // boolean or pagination settings object
77+
rows: ['row 1: col 1', 'row 1: col 2'] // array containing row data
8078
search: true / false || {}, // boolean or search settings object
8179
server: {}, // server settings object
8280
sort: true / false || {}, // boolean or sort settings object
@@ -93,13 +91,11 @@ export default {
9391
```json
9492
{
9593
"autoWidth": true,
96-
"data": {
97-
"cols": [""],
98-
"rows": [""]
99-
},
94+
"cols": [""],
10095
"from": undefined,
10196
"language": undefined,
10297
"pagination": false,
98+
"rows": undefined,
10399
"search": false,
104100
"server": undefined,
105101
"sort": false,
@@ -108,12 +104,6 @@ export default {
108104
}
109105
```
110106

111-
## Known Issues
112-
113-
- The full API for updating the component's data has not yet been implemented.
114-
- The module currently loads CSS in the global scope. A future release will ensure that CSS is scoped solely to the component itself.
115-
- Presently, the `mermaid.css` stylesheet, is the only available theme for Grid.js.
116-
117107
## 🤝 Contributing
118108

119109
Originally authored by [Daniel Sieradski](https://twitter.com/self_agency).

TODO.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
### TODOs
22
| Filename | line # | TODO
33
|:------|:------:|:------
4-
| [src/gridjs-vue.vue](src/gridjs-vue.vue#L2) | 2 | Figure out a way to scope CSS to the component rather than the global scope
5-
| [src/gridjs-vue.vue](src/gridjs-vue.vue#L3) | 3 | Implement full Grid.js API

attributes.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"type": "boolean",
44
"description": "Boolean to automatically set table width. Default: true"
55
},
6+
"gridjs-vue/cols": {
7+
"type": "array",
8+
"description": "Array containing strings of column headers. Default: undefined"
9+
},
610
"gridjs-vue/from": {
711
"type": "string",
812
"description": "String of HTML table selector. Default: undefined"
913
},
10-
"gridjs-vue/data": {
11-
"type": "object",
12-
"description": "Object containing arrays of columns [cols] & rows [rows]. Default: { cols: [''], rows: [''] }"
13-
},
1414
"gridjs-vue/language": {
1515
"type": "object",
1616
"description": "Localization dictionary object. Default: undefined"
@@ -19,6 +19,10 @@
1919
"type": ["boolean", "object"],
2020
"description": "Boolean or pagination settings object. Default: true"
2121
},
22+
"gridjs-vue/rows": {
23+
"type": "array",
24+
"description": "Array containing row data. Default: undefined"
25+
},
2226
"gridjs-vue/search": {
2327
"type": ["boolean", "object"],
2428
"description": "Boolean or search settings object. Default: false"

bili.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ module.exports = {
1313
css: true,
1414
runtimeHelpers: true
1515
},
16-
// scss: true,
1716
babel: {
1817
presets: ['vue', ['@babel/preset-env', { useBuiltIns: 'usage', corejs: 3 }]],
1918
runtimeHelpers: true,

dist/index.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.esm.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)