Skip to content
This repository was archived by the owner on Jun 10, 2021. It is now read-only.

Columnas #26

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules/
npm-debug.log
npm-debug.log
.idea
60 changes: 38 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
# Vue Datasource
#### A Vue.js server side component to create dynamic tables. Compatible with Vue 2.x and Laravel.
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/coderdiaz/vue-datasource/master/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/coderdiaz/vue-datasource.svg?style=flat-square)](https://github.com/coderdiaz/vue-datasource/stargazers)
![](https://img.shields.io/npm/dm/vue-datasource.svg?style=flat-square)
![](https://img.shields.io/npm/v/vue-datasource.svg?style=flat-square)
<p align="center">
<a href="https://github.com/coderdiaz/vue-datasource">
<img src="logotype.png" width="120">
</a>
<h2 align="center">Vue Datasource</h2>
</p>

<p align="center">
A Vue.js server side component to create dynamic tables. Compatible with Vue 2.x and Laravel.
</p>

<p align="center">
<a href="https://github.com/coderdiaz/vue-datasource/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square"></a>
<a href="https://github.com/coderdiaz/vue-datasource/stargazers"><img src="https://img.shields.io/github/stars/coderdiaz/vue-datasource.svg?style=flat-square"></a>
<a href="http://npmjs.com/package/vue-datasource"><img src="https://img.shields.io/npm/dm/vue-datasource.svg?style=flat-square"></a>
<a href="http://npmjs.com/package/vue-datasource"><img src="https://img.shields.io/npm/v/vue-datasource.svg?style=flat-square"></a>
</p>

---

### Demo

[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://forthebadge.com)
[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://forthebadge.com)
[![forthebadge](http://forthebadge.com/images/badges/built-by-developers.svg)](http://forthebadge.com)

!['Screenshot'](https://raw.githubusercontent.com/coderdiaz/vue-datasource/master/screenshot.png)
Expand All @@ -21,16 +34,16 @@ $ npm install vue-datasource
```

```html
<div id="#app">
<datasource
language="en"
:table-data="information.data"
:columns="columns"
:pagination="information.pagination"
:actions="actions"
v-on:change="changePage"
v-on:searching="onSearch"></datasource>
</div>
<div id="#app">
<datasource
language="en"
:table-data="information.data"
:columns="columns"
:pagination="information.pagination"
:actions="actions"
v-on:change="changePage"
v-on:searching="onSearch"></datasource>
</div>
```

```javascript
Expand Down Expand Up @@ -78,11 +91,14 @@ new Vue({
|-------------|-------|
| Spanish | es |
| English | en |
| French | fr |
| Chinese (Simplified) | zh-CN |
| Catalan | ca |

### Columns
Each column object needs a `name` and `key` attributes.
```javascript
{
{
...,
columns: [
{
Expand Down Expand Up @@ -111,7 +127,7 @@ For Laravel users, you can access relationships through the `key` attribute. Let

To get the user's role we would need to define in our columns array:
```javascript
{
{
...,
columns: [
{
Expand All @@ -126,7 +142,7 @@ To get the user's role we would need to define in our columns array:
### Render column
This callback will modify the data for various operations. Such as applying a specific format or an arithmetic operation to the column value and return it.
```javascript
{
{
...,
columns: [
{
Expand All @@ -153,7 +169,7 @@ This callback will modify the data for various operations. Such as applying a sp
to: 15 // End of visible rows
}
}
```
```

### Action Event Sctructure
```javascript
Expand All @@ -176,7 +192,7 @@ This callback will modify the data for various operations. Such as applying a sp
- Using Laravel 5.3 and pagination: [laravel-datasource-example](https://github.com/coderdiaz/laravel-datasource-example).


### Contributions
### Contributions
All contributions are welcome send your PR and Issues.

### License
Expand Down
Loading