|
|
@@ -2,13 +2,13 @@
|
|
2
|
2
|
.page--list.f-row.between
|
|
3
|
3
|
article.f-grow
|
|
4
|
4
|
header
|
|
5
|
|
- h1 {{ site }}: {{ $route.params.type }} list
|
|
|
5
|
+ h1 {{ $route.params.type }} list
|
|
6
|
6
|
section
|
|
7
|
7
|
h4 {{ $route.params.type }}
|
|
8
|
8
|
p {{ Object.values(posts).length }}
|
|
9
|
9
|
p {{ sidebar }}
|
|
10
|
10
|
section(v-for="post in posts")
|
|
11
|
|
- router-link(:to="`./${$route.params.type}/${post.slug}`")
|
|
|
11
|
+ router-link(:to="`./${type}/${post.slug}`")
|
|
12
|
12
|
h4 {{ post.title }}
|
|
13
|
13
|
//- COMPONENT: Make this with a prop
|
|
14
|
14
|
aside(v-if="sidebar").shadow.b-radius
|
|
|
@@ -34,21 +34,16 @@ export default {
|
|
34
|
34
|
allEpisodes: 'allEpisodes',
|
|
35
|
35
|
allEpisodesLoaded: 'allEpisodesLoaded',
|
|
36
|
36
|
}),
|
|
|
37
|
+ type() { // Checks for type and fixes Episodes route edge case
|
|
|
38
|
+ return this.$route.params.type ? this.$route.params.type : this.$route.fullPath.slice(1)
|
|
|
39
|
+ },
|
|
37
|
40
|
posts() {
|
|
38
|
|
- let type = this.$route.params.type ? this.$route.params.type : this.$route.fullPath.slice(1)
|
|
39
|
|
- type = type.charAt(0).toUpperCase() + type.slice(1)
|
|
|
41
|
+ let type = this.type.charAt(0).toUpperCase() + this.type.slice(1)
|
|
40
|
42
|
return this[`all${type}`]
|
|
41
|
43
|
},
|
|
42
|
44
|
},
|
|
43
|
|
- data() {
|
|
44
|
|
- return {
|
|
45
|
|
- loaded: false,
|
|
46
|
|
- site: wp.site_name,
|
|
47
|
|
- }
|
|
48
|
|
- },
|
|
49
|
45
|
mounted() {
|
|
50
|
|
- let type = this.$route.params.type ? this.$route.params.type : this.$route.fullPath.slice(1)
|
|
51
|
|
- type = type.charAt(0).toUpperCase() + type.slice(1)
|
|
|
46
|
+ let type = this.type.charAt(0).toUpperCase() + this.type.slice(1)
|
|
52
|
47
|
this.$store.dispatch(`getAll${type}`)
|
|
53
|
48
|
}
|
|
54
|
49
|
}
|