minor on collections / announcement layout

This commit is contained in:
les
2022-11-10 08:48:48 +01:00
parent 44f0d3ce2a
commit 253d4bcc85
2 changed files with 36 additions and 35 deletions

View File

@@ -4,13 +4,13 @@
<Confirm/>
<Nav/>
<v-main>
<div v-if='showCollections || showBack'>
<!-- <div v-if='showCollections || showBack'>
<v-btn class='ml-2 mt-2' v-if='showBack' outlined color='primary' to='/'><v-icon v-text='mdiChevronLeft'></v-icon></v-btn>
<v-btn class='ml-2 mt-2' outlined v-for='collection in collections' color='primary' :key='collection.id' :to='`/collection/${collection.name}`'>{{collection.name}}</v-btn>
</div>
<v-fade-transition hide-on-leave>
</div> -->
<!-- <v-fade-transition hide-on-leave> -->
<nuxt />
</v-fade-transition>
<!-- </v-fade-transition> -->
</v-main>
<Footer/>
@@ -35,28 +35,24 @@ export default {
link: [{ rel: 'icon', type: 'image/png', href: this.settings.baseurl + '/logo.png' }],
}
},
data () {
return { collections: [], mdiChevronLeft }
},
async fetch () {
if (this.$route.name && ['tag-tag', 'index', 'g-collection', 'p-place'].includes(this.$route.name)) {
this.collections = await this.$axios.$get('collections').catch(_e => [])
} else {
this.collections = []
}
},
// async fetch () {
// if (this.$route.name && ['tag-tag', 'index', 'g-collection', 'p-place'].includes(this.$route.name)) {
// this.collections = await this.$axios.$get('collections').catch(_e => [])
// } else {
// this.collections = []
// }
// },
name: 'Default',
components: { Nav, Snackbar, Footer, Confirm },
computed: {
...mapState(['settings', 'locale']),
showBack () {
return ['tag-tag', 'collection-collection', 'place-place', 'search', 'announcement-id'].includes(this.$route.name)
},
showCollections () {
if (!this.collections || this.collections.length === 0) return false
return ['tag-tag', 'index', 'g-collection', 'p-place'].includes(this.$route.name)
}
...mapState(['settings']),
// showBack () {
// return ['tag-tag', 'collection-collection', 'place-place', 'search', 'announcement-id'].includes(this.$route.name)
// },
// showCollections () {
// if (!this.collections || this.collections.length === 0) return false
// return ['tag-tag', 'index', 'g-collection', 'p-place'].includes(this.$route.name)
// }
},
created () {
this.$vuetify.theme.dark = this.settings['theme.is_dark']