Просмотр исходного кода

:bug: fixed page route bug | have to block template wth v-if

tags/0.9.0
J 5 лет назад
Родитель
Сommit
7ce56d42e2

+ 1830
- 2127
vue-theme/package-lock.json
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 14
- 14
vue-theme/package.json Просмотреть файл

@@ -15,35 +15,35 @@
15 15
   "author": "TOJ",
16 16
   "license": "UNLICENSED",
17 17
   "devDependencies": {
18
-    "@babel/core": "^7.12.3",
18
+    "@babel/core": "^7.12.10",
19 19
     "@babel/plugin-syntax-dynamic-import": "^7.8.3",
20
-    "@babel/preset-env": "^7.9.0",
21
-    "@vue/compiler-sfc": "^3.0.2",
22
-    "axios": "^0.19.2",
23
-    "babel-loader": "^8.1.0",
20
+    "@babel/preset-env": "^7.12.11",
21
+    "@vue/compiler-sfc": "^3.0.5",
22
+    "axios": "^0.21.1",
23
+    "babel-loader": "^8.2.2",
24 24
     "css-loader": "^3.6.0",
25
-    "file-loader": "^6.1.1",
25
+    "file-loader": "^6.2.0",
26 26
     "postcss-calc": "^7.0.5",
27 27
     "postcss-import": "^12.0.1",
28 28
     "postcss-loader": "^3.0.0",
29 29
     "precss": "^4.0.0",
30 30
     "pug": "^2.0.4",
31
-    "pug-plain-loader": "^1.0.0",
31
+    "pug-plain-loader": "^1.1.0",
32 32
     "style-loader": "^2.0.0",
33 33
     "sugarss": "^2.0.0",
34
-    "url-loader": "^4.0.0",
34
+    "url-loader": "^4.1.1",
35 35
     "vue-hot-reload-api": "^2.3.4",
36
-    "vue-loader": "^16.0.0-beta.8",
36
+    "vue-loader": "^16.1.2",
37 37
     "vue-template-compiler": "^2.6.12",
38
-    "webpack": "^4.44.2",
38
+    "webpack": "^4.45.0",
39 39
     "webpack-cli": "^3.3.12",
40
-    "webpack-dev-server": "^3.11.0"
40
+    "webpack-dev-server": "^3.11.1"
41 41
   },
42 42
   "dependencies": {
43 43
     "compression-webpack-plugin": "^3.1.0",
44
-    "vue": "^3.0.2",
45
-    "vue-router": "^4.0.0-rc.1",
46
-    "vuex": "^4.0.0-beta.4"
44
+    "vue": "^3.0.5",
45
+    "vue-router": "^4.0.2",
46
+    "vuex": "^4.0.0-rc.2"
47 47
   },
48 48
   "babel": {
49 49
     "presets": [

+ 4
- 4
vue-theme/src/components/navigation/navigation.vue Просмотреть файл

@@ -9,16 +9,16 @@ nav.main.f-row.center
9 9
         li.f-grow
10 10
             p  
11 11
         li
12
-            router-link(to="/")
12
+            router-link(:to="`/`")
13 13
                 p.t-up home
14 14
         li
15
-            router-link(to="/posts")
15
+            router-link(:to="`/posts`")
16 16
                 p.t-up news
17 17
         li
18
-            router-link(to="/artists")
18
+            router-link(:to="`/artists`")
19 19
                 p.t-up artists
20 20
         li
21
-            router-link(to="/episodes")
21
+            router-link(:to="`/episodes`")
22 22
                 p.t-up episodes
23 23
 </template>
24 24
 

+ 4
- 4
vue-theme/src/pages/index.vue Просмотреть файл

@@ -3,25 +3,25 @@
3 3
 .page--index.f-row.between
4 4
     article.f-grow
5 5
         .f-row
6
-            section(v-if="allEpisodesLoaded").shadow
6
+            section(v-if="allEpisodesLoaded && allEpisodes.length").shadow
7 7
                 router-link(:to="`./episodes`")
8 8
                     h4.t-cap episodes
9 9
                 router-link(:to="{ path: `/episodes/${Object.values(allEpisodes)[0].slug}` }")
10 10
                     p {{ Object.values(allEpisodes)[0].title }}
11 11
 
12
-            section(v-if="allArtistsLoaded").shadow
12
+            section(v-if="allArtistsLoaded && allArtists.length").shadow
13 13
                 router-link(:to="`./artists`")
14 14
                     h4.t-cap artists
15 15
                 router-link(:to="{ path: `/artists/${Object.values(allArtists)[0].slug}` }")
16 16
                     p {{ Object.values(allArtists)[0].title }}
17 17
                     
18
-            section(v-if="allPagesLoaded").shadow
18
+            section(v-if="allPagesLoaded && allPages.length").shadow
19 19
                 h4.t-cap pages
20 20
                 router-link(:to="{ path: `/pages/${Object.values(allPages)[0].slug}` }")
21 21
                     p {{ Object.values(allPages)[0].title }}
22 22
         
23 23
         .f-row
24
-            section(v-if="allPostsLoaded").shadow
24
+            section(v-if="allPostsLoaded && allPosts.length").shadow
25 25
                 router-link(:to="`./posts`")
26 26
                     h4.t-cap posts
27 27
                 router-link(:to="{ path: `/posts/${Object.values(allPosts)[0].slug}` }")

+ 1
- 1
vue-theme/src/pages/list.vue Просмотреть файл

@@ -7,7 +7,7 @@
7 7
                 h1 &nbsp;sorted by {{ sortBy.replace('-', ' ') }}
8 8
 
9 9
         .posts(:class="{ 'is-grid': isGrid }")
10
-            section(v-for="post in posts").shadow
10
+            section(v-for="post in posts" :key="post.slug").shadow.post
11 11
                 router-link(:to="`/${type}/${post.slug}`")
12 12
                     h4 {{ post.title }} 
13 13
                     p(style="font-size: 9px;") {{ post.date }}

+ 20
- 24
vue-theme/src/pages/single.vue Просмотреть файл

@@ -1,32 +1,28 @@
1 1
 <template lang="pug">
2 2
 .page--single.f-row.between
3
-    article.f-grow.shadow
3
+    article(v-if="post").f-grow.shadow
4 4
         header
5
-            h1 {{ type }}:{{ $route.params.slug }} single
6
-            p categories: 
7
-                span(v-for="category in post.categories") {{ category }}&nbsp;
5
+            h1 {{ type }}:{{ $route.params.slug }} {{ post.title }}
6
+            p categories: {{ post.categories }}
8 7
 
9
-        section(v-if="post")
10
-            h4 {{ post.title }}
8
+        .post-single.block-wrapper(v-for="(block, i) in post.blocks" :key="`block-${i}`")
9
+            //- ?: are objects are always gallery blocks
10
+            .gallery.block(v-if="typeof block === 'object'")
11
+                p gallery number: {{ i }}
12
+                ul
13
+                    li(v-for="(imageID, j) in post.galleries[block.gallery].ids") 
14
+                        button(@click="openGallery(i - 1, j)") gallery: {{ i }} image: {{ imageID }}
15
+                //- Fullscreen gallery
16
+                gallery(
17
+                    v-if="activeGalleryIndex == (i - 1)"
18
+                    :image-ids="post.galleries[block.gallery].ids"
19
+                    :activeImageIndex="activeImageIndex"
20
+                    v-on:close="activeGalleryIndex = -1"
21
+                    :image-sizes="post.attached"
22
+                )
11 23
 
12
-            .block-wrapper(v-for="(block, i) in post.blocks")
13
-                    //- ?: are objects are always gallery blocks
14
-                    .gallery.block(v-if="typeof block === 'object'")
15
-                        p gallery number: {{ i }}
16
-                        ul
17
-                            li(v-for="(imageID, j) in post.galleries[block.gallery].ids") 
18
-                                button(@click="openGallery(i - 1, j)") gallery: {{ i }} image: {{ imageID }}
19
-                        //- Fullscreen gallery
20
-                        gallery(
21
-                            v-if="activeGalleryIndex == (i - 1)"
22
-                            :image-ids="post.galleries[block.gallery].ids"
23
-                            :activeImageIndex="activeImageIndex"
24
-                            v-on:close="activeGalleryIndex = -1"
25
-                            :image-sizes="post.attached"
26
-                        )
27
-
28
-                    //- Just a regular block
29
-                    .block(v-else v-html="block")
24
+            //- Just a regular block
25
+            .block(v-else v-html="block")
30 26
 
31 27
     sidebar(v-if="sidebar" :type="`${type}`")
32 28
         .shadow

+ 2
- 2
vue-theme/src/store/modules/media.js Просмотреть файл

@@ -6,8 +6,8 @@ const state = {
6 6
 }
7 7
 
8 8
 const getters = {
9
-    allArtists: state => state.all,
10
-    allArtistsLoaded: state => state.loaded,
9
+    allMedia: state => state.all,
10
+    allMediaLoaded: state => state.loaded,
11 11
 }
12 12
 
13 13
 const actions = {

Загрузка…
Отмена
Сохранить