This commit is contained in:
lesion 2022-05-20 12:10:32 +02:00
parent 9fa3d03de5
commit 63b9d41470
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 37 additions and 3 deletions

View file

@ -13,8 +13,8 @@
v-card-actions.pt-0.actions.justify-space-between
.tags
v-chip.ml-1.mt-1(v-for='tag in event.tags.slice(0,6)' small
:key='tag' outlined color='primary' @click="$emit('tagclick', tag)") {{tag}}
v-chip.ml-1.mt-1(v-for='tag in event.tags.slice(0,6)' small :to='`/tag/${tag}`'
:key='tag' outlined color='primary' v-text='tag')
client-only
v-menu(offset-y)

34
pages/tag/_tag.vue Normal file
View file

@ -0,0 +1,34 @@
<template>
<v-container id='home' class='pa-0 pa-sm-2' fluid>
<v-btn text color='primary' to='/'><v-icon v-text='mdiChevronLeft'/> Home</v-btn><h2 class='d-inline'>{{$t('event.tag_description')}} <u>{{tag}}</u></h2>
<!-- Events -->
<!-- .mb-2.mt-1.pl-1.pl-sm-2 -->
<div id="events">
<Event :event='event' v-for='(event, idx) in events' :lazy='idx>2' :key='event.id'></Event>
</div>
</v-container>
</template>
<script>
import { mdiChevronLeft } from '@mdi/js'
import Event from '@/components/Event'
export default {
name: 'Tag',
components: { Event },
data () {
return { mdiChevronLeft }
},
async asyncData ({ $axios, params, error }) {
try {
const tag = params.tag
const events = await $axios.$get(`/events?tags=${params.tag}`)
return { events, tag }
} catch (e) {
error({ statusCode: 400, message: 'Error!' })
}
}
}
</script>