Skip to content

Commit 900dd0b

Browse files
shafiqueqadriYousef Sultan
authored andcommitted
French, Dutch Languages and Keys for loops (#34)
1 parent 023c900 commit 900dd0b

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

src/DataTable.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
<div class="table-header">
44
<span class="table-title">{{title}}</span>
55
<div class="actions">
6-
<a v-for="button in customButtons" href="javascript:undefined"
6+
<a v-for="(button, index) in customButtons" href="javascript:undefined"
77
class="waves-effect btn-flat nopadding"
88
v-if="button.hide ? !button.hide : true"
9-
@click="button.onclick">
9+
@click="button.onclick"
10+
:key="index"
11+
>
1012
<i class="material-icons">{{button.icon}}</i>
1113
</a>
1214
<a href="javascript:undefined"
@@ -42,6 +44,7 @@
4244
<thead>
4345
<tr>
4446
<th v-for="(column, index) in columns"
47+
:key="index"
4548
@click="sort(index)"
4649
:class="(sortable ? 'sorting ' : '')
4750
+ (sortColumn === index ?
@@ -56,8 +59,8 @@
5659
</thead>
5760

5861
<tbody>
59-
<tr v-for="(row, index) in paginated" :class="{ clickable : clickable }" @click="click(row)">
60-
<td v-for="column in columns" :class=" { numeric : column.numeric } ">
62+
<tr v-for="(row, index) in paginated" :class="{ clickable : clickable }" :key="index" @click="click(row)">
63+
<td v-for="column in columns" :class=" { numeric : column.numeric } " :key="index">
6164
<div v-if="!column.html"> {{ collect(row, column.field) }} </div>
6265
<div v-if="column.html" v-html="collect(row, column.field)"></div>
6366
</td>
@@ -71,7 +74,7 @@
7174
<label>
7275
<span>{{lang['rows_per_page']}}:</span>
7376
<select class="browser-default" @change="onTableLength">
74-
<option v-for="option in perPageOptions" :value="option" :selected="option == currentPerPage">
77+
<option v-for="option in perPageOptions" :value="option" :selected="option == currentPerPage" :key="index">
7578
{{ option === -1 ? lang['all'] : option }}
7679
</option>
7780
</select>

src/locales/fr.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"rows_per_page": "Lignes par page",
3+
"out_of_pages": "de",
4+
"all": "Tout",
5+
"search_data": "Rechercher des données"
6+
}

src/locales/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ module.exports = {
33
ar: require('./ar.json'),
44
es: require('./es.json'),
55
br: require('./br.json'),
6-
cat: require('./cat.json')
6+
cat: require('./cat.json'),
7+
fr: require('./fr.json'),
8+
nl: require('./nl.json'),
79
};

src/locales/nl.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"rows_per_page": "Rijen per pagina",
3+
"out_of_pages": "van",
4+
"all": "Alle",
5+
"search_data": "Zoek gegevens"
6+
}

0 commit comments

Comments
 (0)