|
|
@@ -5,16 +5,17 @@
|
|
5
|
5
|
h1 {{ type }} list
|
|
6
|
6
|
span(v-if="sortBy")
|
|
7
|
7
|
h1 sorted by {{ sortBy.replace('-', ' ') }}
|
|
8
|
|
-
|
|
|
8
|
+
|
|
9
|
9
|
section.shadow
|
|
10
|
10
|
h4 {{ type }}
|
|
11
|
11
|
p {{ Object.values(posts).length }}
|
|
12
|
12
|
p {{ sidebar }}
|
|
13
|
|
-
|
|
14
|
|
- section(v-for="post in posts").shadow
|
|
15
|
|
- router-link(:to="`/${type}/${post.slug}`")
|
|
16
|
|
- h4 {{ post.title }}
|
|
17
|
|
- p(style="font-size: 9px;") {{ post.date }}
|
|
|
13
|
+
|
|
|
14
|
+ .posts(:class="{ 'is-grid': isGrid }")
|
|
|
15
|
+ section(v-for="post in posts").shadow
|
|
|
16
|
+ router-link(:to="`/${type}/${post.slug}`")
|
|
|
17
|
+ h4 {{ post.title }}
|
|
|
18
|
+ p(style="font-size: 9px;") {{ post.date }}
|
|
18
|
19
|
|
|
19
|
20
|
sidebar(v-if="sidebar" :type="`${type}`")
|
|
20
|
21
|
.shadow
|
|
|
@@ -54,6 +55,9 @@ export default {
|
|
54
|
55
|
allEpisodes: 'allEpisodes',
|
|
55
|
56
|
allEpisodesLoaded: 'allEpisodesLoaded',
|
|
56
|
57
|
}),
|
|
|
58
|
+ isGrid() {
|
|
|
59
|
+ return this.$route.query.grid === 'true'
|
|
|
60
|
+ },
|
|
57
|
61
|
type() { // Checks for type and fixes Episodes route edge case
|
|
58
|
62
|
return typeFromRoute(this.$route)
|
|
59
|
63
|
},
|
|
|
@@ -89,6 +93,17 @@ export default {
|
|
89
|
93
|
|
|
90
|
94
|
this.$store.dispatch(`getAll${type}`, this.sortBy)
|
|
91
|
95
|
this.$store.commit('SET_HERO', type)
|
|
|
96
|
+ console.log(this.isGrid)
|
|
92
|
97
|
}
|
|
93
|
98
|
}
|
|
94
|
|
-</script>
|
|
|
99
|
+</script>
|
|
|
100
|
+
|
|
|
101
|
+<style lang="postcss">
|
|
|
102
|
+article
|
|
|
103
|
+ .is-grid
|
|
|
104
|
+ display: flex
|
|
|
105
|
+ flex-direction: row
|
|
|
106
|
+ section
|
|
|
107
|
+ width: 33%
|
|
|
108
|
+
|
|
|
109
|
+</style>
|