gridjs-vue
Version:
A Vue.js wrapper component for Grid.js
85 lines (63 loc) • 2.27 kB
Markdown
# gridjs-vue

A Vue wrapper component for [Grid.js](https://gridjs.io).
[](https://www.npmjs.com/package/gridjs-vue)


[](https://github.com/grid-js/gridjs-vue/issues)
[](https://discord.com/invite/K55BwDY)
## Install
```sh
npm install gridjs-vue
```
Also available on [unpkg](https://unpkg.com/browse/gridjs-vue/dist/) and [Skypack](https://www.skypack.dev/view/gridjs-vue)!
```html
<script>
import { Grid } from 'gridjs-vue'
export default {
components: {
Grid
}
}
</script>
```
## Basic Usage
Pass `columns` (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.
**[Read the full documentation](docs/index.md) for further configuration options.**
### Example
```html
<template>
<grid :columns="columns" :rows="rows" @ready="myMethod"></grid>
</template>
<script>
import Grid from 'gridjs-vue'
export default {
name: 'Cars',
components: {
Grid
},
data() {
return {
columns: ['Make', 'Model', 'Year', 'Color'],
rows: [
['Ford', 'Fusion', '2011', 'Silver'],
['Chevrolet', 'Cruz', '2018', 'White']
]
}
},
methods: {
myMethod() {
console.log("It's ready!")
}
}
}
</script>
```
## 🤝 Contributing
Originally authored by [Daniel Sieradski](https://twitter.com/self_agency).
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/grid-js/gridjs-vue/issues).
## Show your support
Give a ⭐️ if this project helped you!