fix: description, tags, etc now show properly according to video

This commit is contained in:
Resi Respati 2017-04-21 14:17:06 +07:00
parent cb7e3e83e3
commit c77f65d3c2
No known key found for this signature in database
GPG Key ID: BB70B066307F92FD
2 changed files with 11 additions and 6 deletions

View File

@ -5,9 +5,9 @@
</div>
<div class="metadata">
<h4>{{ title }}</h4>
<p>{{ description }}</p>
<p v-if="description">{{ description }}</p>
<video-tag-list v-bind:tags="tags"></video-tag-list>
<video-tag-list v-if="tags.length > 0" v-bind:tags="tags"></video-tag-list>
</div>
<div class="links">
<a href="#" class="previous">&larr; Previous</a>
@ -25,9 +25,9 @@ export default {
data () {
return {
id: this.$route.params.id,
title: 'What if Barry Bonds had played without a baseball bat? | Chart Party',
description: 'A must watch even if you don\'t like sports. Jon Bois from SB Nation uses some neat statistics to figure out if baseballer Barry Bonds would still do well, even without carrying a bat.',
tags: ['sports', 'statistics']
title: this.$route.params.title,
description: this.$route.params.description,
tags: this.$route.params.tags
}
},
filters: {

View File

@ -3,7 +3,12 @@
<h2>this week's playlist</h2>
<ul class="video-list">
<li v-for="video in videos">
<router-link :to="{ name: 'Video', params: { id: video.id }}">{{ video.title }}</router-link>
<router-link :to="{ name: 'Video', params: {
id: video.id,
title: video.title,
description: video.description,
tags: video.tags
}}">{{ video.title }}</router-link>
</li>
</ul>
<p><router-link to="/">Home</router-link></p>