feat(item details page): add basic item details page

This commit is contained in:
Cameron 2020-09-05 06:20:10 +01:00
parent 604f1e79cd
commit c94c6d6cd9

View File

@ -0,0 +1,41 @@
<template>
<div>
<v-img :src="imageLink(Item.Id, 'backdrop')"></v-img>
<h1>{{ Item.Name }}</h1>
<p>{{ Item.Overview }}</p>
<v-btn color="primary">Play {{ Item.Type }} </v-btn>
<v-btn>More</v-btn>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
data() {
return {
Name: '',
Item: {},
Seasons: {},
Episodes: []
};
},
async beforeMount() {
const Item = await this.$itemsApi.getItems({
uId: this.$auth.user.Id,
userId: this.$auth.user.Id,
ids: this.$route.params.itemId,
fields: 'Overview'
});
this.Item = Item.data.Items[0];
},
methods: {
imageLink(id: string, type: string) {
const url = `${this.$axios.defaults.baseURL}/Items/${id}/Images/${type}`;
return url;
}
}
});
</script>