You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51-9Lines changed: 51 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
A Vue wrapper component for [Grid.js](https://gridjs.io).
6
6
7
+
[](https://www.npmjs.com/package/gridjs-vue)[](https://gridjs.io/docs/index)[](https://david-dm.org/grid-js/gridjs-vue)[](https://github.com/grid-js/gridjs-vue/issues)[](https://discord.com/invite/K55BwDY)
8
+
7
9
## Install
8
10
9
11
```sh
@@ -30,16 +32,16 @@ npm install gridjs-vue
30
32
31
33
```js
32
34
/* in `main.js` or wherever you specify your global components */
33
-
importGridfrom'gridjs-vue'
35
+
import{ GridGlobal }from'gridjs-vue'
34
36
35
-
Vue.use(Grid)
37
+
Vue.use(GridGlobal)
36
38
```
37
39
38
40
## Usage
39
41
40
-
Pass `cols` (an array of column headers) and either `rows`, `from`, or `server` as a data source to the component. Everything else is optional.
42
+
Pass `cols` (an array of column headers) and either `rows`, `from`, or `server` as a data source to the component. Everything else is optional. Pass in new data to update the table.
41
43
42
-
Refer to [Grid.js documentation](https://gridjs.io/docs/config/) for specific configuration options.
44
+
Refer to [Grid.js documentation](https://gridjs.io/docs/config/) for specific configuration options. This module may lag behind the main Grid.js module somewhat, so check the API version badge at the top of this README.
43
45
44
46
### Basic Example
45
47
@@ -69,6 +71,45 @@ Refer to [Grid.js documentation](https://gridjs.io/docs/config/) for specific co
69
71
</script>
70
72
```
71
73
74
+
### Grid.js Helper Functions
75
+
76
+
If you install the component as a plugin, rather than importing it directly into your component, the following helpers are added to the Vue prototype and are available globally.
77
+
78
+
#### `this.$gridjs.createRef`
79
+
80
+
Returns a [reference to the Grid.js instance](https://gridjs.io/docs/examples/stock-market).
81
+
82
+
```js
83
+
constref=this.$gridjs.createRef
84
+
```
85
+
86
+
#### `this.$gridjs.h`
87
+
88
+
Renders a [Preact virtual DOM instance](https://gridjs.io/docs/examples/virtual-dom).
0 commit comments