Add albums cover, fix left bar icon
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<LeftBlock
|
||||
title="HOME"
|
||||
description="kreorg photos"
|
||||
picture="/pictures/home.jpg"
|
||||
:leftPanelClosed="leftPanelClosed"></LeftBlock>
|
||||
|
||||
:title="title"
|
||||
:description="description"
|
||||
:picture="picture"></LeftBlock>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -13,6 +11,9 @@
|
||||
import 'reflect-metadata';
|
||||
import { Vue, Component, Prop } from 'vue-property-decorator';
|
||||
|
||||
import { StoreType } from '@/store';
|
||||
import { IAlbum } from '@/store/albums/state';
|
||||
|
||||
import LeftBlock from '@/components/LeftBlock.vue';
|
||||
|
||||
|
||||
@@ -23,7 +24,37 @@ import LeftBlock from '@/components/LeftBlock.vue';
|
||||
}
|
||||
})
|
||||
export default class AlbumPage extends Vue {
|
||||
@Prop({required: true}) public readonly leftPanelClosed!: boolean;
|
||||
get album(): IAlbum | null {
|
||||
const albums = (this.$store as StoreType).state.albums.albums;
|
||||
|
||||
if (albums === null)
|
||||
return null;
|
||||
|
||||
const album = albums.filter(item => item.folderName === this.$route.params.name);
|
||||
|
||||
if (album.length === 0)
|
||||
return null;
|
||||
|
||||
return album[0];
|
||||
}
|
||||
|
||||
get title(): string {
|
||||
if (this.album === null)
|
||||
return '';
|
||||
return this.album.name;
|
||||
}
|
||||
|
||||
get description(): string {
|
||||
if (this.album === null)
|
||||
return '';
|
||||
return this.album.description;
|
||||
}
|
||||
|
||||
get picture(): string {
|
||||
if (this.album === null)
|
||||
return '';
|
||||
return `/pictures/albums/${this.album.folderName}/${this.album.coverFileName}`
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user