mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
minor
This commit is contained in:
parent
9fa3d03de5
commit
63b9d41470
3 changed files with 37 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -154,7 +154,7 @@ export default {
|
|||
if (!this.tagName) { return this.tags.slice(0, 10).map(t => t.tag) }
|
||||
const tagName = this.tagName.trim().toLowerCase()
|
||||
return this.tags.filter(t => t.tag.toLowerCase().includes(tagName)).map(t => t.tag)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['updateMeta']),
|
||||
|
|
34
pages/tag/_tag.vue
Normal file
34
pages/tag/_tag.vue
Normal 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>
|
Loading…
Reference in a new issue