Przeglądaj źródła

feat: made sidebar sticky

tags/0.9.0
John Maeda 6 lat temu
rodzic
commit
227c1868fe

+ 10
- 27
vue-theme/src/components/sidebars/sidebar.vue Wyświetl plik

@@ -1,5 +1,5 @@
1 1
 <template lang="pug">
2
-aside
2
+aside.sidebar
3 3
     section
4 4
         slot
5 5
         .shadow.b-radius(v-if="type === 'artists'")
@@ -13,34 +13,17 @@ import { mapGetters } from 'vuex'
13 13
 
14 14
 export default {
15 15
     props: {
16
-        sidebar: {
17
-            type: Boolean
18
-        },
19 16
         type: {
20 17
             type: String
21 18
         }
22 19
     },
23
-    computed: {
24
-        ...mapGetters({
25
-            allArtists: 'allArtists',
26
-            allArtistsLoaded: 'allArtistsLoaded',
27
-
28
-            allEpisodes: 'allEpisodes',
29
-            allEpisodesLoaded: 'allEpisodesLoaded',
30
-        }),
31
-        posts() {
32
-            let type = this.$route.params.type
33
-            type = type.charAt(0).toUpperCase() + type.slice(1)
34
-
35
-            // Return list keyed by slug
36
-            return Object.values(this[`all${type}`]).reduce((postsMap, post) => { 
37
-                postsMap[post.slug] = post
38
-                return postsMap
39
-            }, {})
40
-        },
41
-    },
42
-    mounted() {
43
-        // TODO: this should be conditional after checking vuex stat
44
-    }
20
+    computed: {},
21
+    mounted() {}
45 22
 }
46
-</script>
23
+</script>
24
+
25
+<style lang="postcss">
26
+aside.sidebar
27
+    position: sticky
28
+    top: 0
29
+</style>

+ 2
- 2
vue-theme/src/pages/single.vue Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 <template lang="pug">
2 2
 .page--single.f-row.between
3
-    article.f-grow
3
+    article.f-grow.shadow.b-radius
4 4
         header
5 5
             h1 {{ type }}:{{ $route.params.slug }} single
6 6
         section
@@ -29,7 +29,7 @@ export default {
29 29
 
30 30
             allPosts: 'allPosts',
31 31
             allPostsLoaded: 'allPostsLoaded',
32
-            
32
+
33 33
             allArtists: 'allArtists',
34 34
             allArtistsLoaded: 'allArtistsLoaded',
35 35
 

Ładowanie…
Anuluj
Zapisz