traxxx/assets/components/tag/tag.vue

84 lines
1.6 KiB
Vue
Raw Normal View History

<template>
<div
v-if="tag"
class="content tag"
>
<FilterBar :fetch-releases="fetchReleases" />
<div class="header">
<span>
<h2 class="title">
<Icon icon="price-tag4" />
{{ tag.name }}
</h2>
<span class="description">{{ tag.description }}</span>
</span>
</div>
<div class="content-inner">
<Releases
:releases="releases"
:context="tag.name"
/>
</div>
</div>
</template>
<script>
import FilterBar from '../header/filter-bar.vue';
import Releases from '../releases/releases.vue';
async function fetchReleases() {
this.releases = await this.$store.dispatch('fetchTagReleases', this.$route.params.tagSlug);
}
async function mounted() {
[[this.tag]] = await Promise.all([
this.$store.dispatch('fetchTags', this.$route.params.tagSlug),
this.fetchReleases(),
]);
this.pageTitle = this.tag.name;
}
export default {
components: {
FilterBar,
Releases,
},
data() {
return {
tag: null,
releases: null,
pageTitle: null,
};
},
mounted,
methods: {
fetchReleases,
},
};
</script>
<style lang="scss" scoped>
@import 'theme';
.header {
display: flex;
justify-content: space-between;
padding: 1rem;
}
.title {
display: inline-block;
margin: 0 .5rem 0 0;
text-transform: capitalize;
.icon {
width: 1.25rem;
height: 1.25rem;
}
}
</style>