Skip to content

Commit bde1276

Browse files
committed
Fix List.vue pagination
1 parent 1fb9fe7 commit bde1276

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

templates/vue/components/foo/List.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
type="button"
1212
class="btn btn-basic btn-sm"
1313
@click="getPage(view['hydra:first'])"
14-
:disabled="!view['hydra:first']"
14+
:disabled="!view['hydra:previous']"
1515
>First</button>
1616
&nbsp;
1717
<button
@@ -30,7 +30,7 @@
3030
<button
3131
type="button" class="btn btn-basic btn-sm"
3232
@click="getPage(view['hydra:last'])"
33-
:disabled="!view['hydra:last']"
33+
:disabled="view['hydra:last']"
3434
>Last</button>
3535
&nbsp;
3636
</span>
@@ -85,9 +85,9 @@
8585
'loading',
8686
'view'
8787
]),
88-
methods: mapActions([
89-
'getPage'
90-
]),
88+
methods: mapActions({
89+
getPage: 'getItems'
90+
}),
9191
created () {
9292
this.$store.dispatch('{{{lc}}}/list/getItems')
9393
}

templates/vue/store/modules/foo/list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ const getters = {
3737
};
3838

3939
const actions = {
40-
getItems({ commit }) {
40+
getItems({ commit }, page = '/{{{ name }}}') {
4141
commit(loading(true));
4242

43-
{{{ lc }}}Fetch('/{{{ name }}}')
43+
{{{ lc }}}Fetch(page)
4444
.then(response => response.json())
4545
.then(data => {
4646
commit(loading(false));

0 commit comments

Comments
 (0)