Przeglądaj źródła

feat: display episode and artist on index

tags/0.9.0
J 6 lat temu
rodzic
commit
5fa33e0a67
2 zmienionych plików z 17 dodań i 0 usunięć
  1. 13
    0
      vue-theme/src/pages/index.vue
  2. 4
    0
      vue-theme/src/store/index.js

+ 13
- 0
vue-theme/src/pages/index.vue Wyświetl plik

@@ -4,6 +4,12 @@
4 4
     article.f-grow.shadow.b-radius
5 5
         header
6 6
             h1 {{ site }}: index
7
+        section(v-if="allEpisodesLoaded")
8
+            h4 Episodes
9
+            p {{ Object.values(allEpisodes).length }}
10
+        section(v-if="allArtistsLoaded")
11
+            h4 artists
12
+            p {{ Object.values(allArtists).length }}
7 13
         section(v-if="allPagesLoaded")
8 14
             h4 pages
9 15
             p {{ Object.values(allPages).length }}
@@ -43,6 +49,10 @@ export default {
43 49
             allPostsLoaded: 'allPostsLoaded',
44 50
             allPosts: 'allPosts',
45 51
             allPagesLoaded: 'allPagesLoaded',
52
+            allArtists: 'allArtists',
53
+            allArtistsLoaded: 'allArtistsLoaded',
54
+            allEpisodes: 'allEpisodes',
55
+            allEpisodesLoaded: 'allEpisodesLoaded',
46 56
         }),
47 57
     },
48 58
     data() {
@@ -57,6 +67,9 @@ export default {
57 67
 
58 68
         this.$store.dispatch('getAllPages')
59 69
         this.$store.dispatch('getAllPosts')
70
+
71
+        this.$store.dispatch('getAllArtists')
72
+        this.$store.dispatch('getAllEpisodes')
60 73
     }
61 74
 }
62 75
 </script>

+ 4
- 0
vue-theme/src/store/index.js Wyświetl plik

@@ -7,6 +7,8 @@ import * as getters from './getters'
7 7
 
8 8
 import page from './modules/page'
9 9
 import post from './modules/post'
10
+import artist from './modules/artist'
11
+import episode from './modules/episode'
10 12
 
11 13
 Vue.use(Vuex)
12 14
 
@@ -30,6 +32,8 @@ export default new Vuex.Store({
30 32
   modules: {
31 33
       post,
32 34
       page,
35
+      artist,
36
+      episode
33 37
   },
34 38
   strict: debug,
35 39
 })

Ładowanie…
Anuluj
Zapisz