traxxx/assets/components/home/home.vue

74 lines
1.3 KiB
Vue
Raw Normal View History

<template>
2020-05-22 02:32:16 +00:00
<div class="content">
<div class="content-inner">
2020-06-27 02:50:13 +00:00
<FilterBar
:fetch-releases="fetchReleases"
:is-home="true"
:items-total="totalCount"
:items-per-page="limit"
/>
2020-05-22 02:32:16 +00:00
<Releases :releases="releases" />
<Pagination
2020-05-25 00:02:28 +00:00
v-if="totalCount > 0"
2020-05-22 02:32:16 +00:00
:items-total="totalCount"
:items-per-page="limit"
class="pagination-bottom"
/>
</div>
</div>
</template>
<script>
import FilterBar from '../header/filter-bar.vue';
import Releases from '../releases/releases.vue';
2020-05-22 02:32:16 +00:00
import Pagination from '../pagination/pagination.vue';
2019-09-10 14:48:04 +00:00
async function fetchReleases() {
2020-05-22 02:32:16 +00:00
const { releases, totalCount } = await this.$store.dispatch('fetchReleases', {
limit: this.limit,
2020-05-26 23:40:10 +00:00
range: this.$route.params.range,
2020-05-22 02:32:16 +00:00
pageNumber: Number(this.$route.params.pageNumber) || 1,
});
this.totalCount = totalCount;
this.releases = releases;
}
async function route() {
2020-05-22 02:32:16 +00:00
await this.fetchReleases();
}
async function mounted() {
2020-05-22 02:32:16 +00:00
this.pageTitle = '';
2020-05-22 02:32:16 +00:00
await this.fetchReleases();
}
export default {
2020-05-22 02:32:16 +00:00
components: {
FilterBar,
Releases,
Pagination,
},
data() {
return {
releases: [],
networks: [],
pageTitle: null,
limit: 15,
totalCount: 0,
from: null,
};
},
watch: {
$route: route,
},
mounted,
methods: {
fetchReleases,
},
};
</script>