소스 검색

:sparkles: page map to welcome index.vue | fixing some hero bugs

tags/0.9.0
j 4 년 전
부모
커밋
1903fe9430
5개의 변경된 파일13개의 추가작업 그리고 11개의 파일을 삭제
  1. 2
    3
      vue-theme/src/components/hero.vue
  2. 7
    4
      vue-theme/src/pages/index.vue
  3. 2
    2
      vue-theme/src/pages/list.vue
  4. 1
    1
      vue-theme/src/pages/single.vue
  5. 1
    1
      vue-theme/src/store/index.js

+ 2
- 3
vue-theme/src/components/hero.vue 파일 보기

@@ -32,7 +32,6 @@ export default {
32 32
             showPlaybutton: state => state.hero.playbutton,
33 33
         }),
34 34
         heroIdFromUrl() {
35
-            console.log()
36 35
             const url = this.showHero.split('/')
37 36
             return url.pop()
38 37
         }
@@ -48,8 +47,8 @@ export default {
48 47
     },
49 48
     watch: {
50 49
         $route() {
51
-            console.log('remounting hero')
52
-            console.log(this.$store)
50
+            // console.log('remounting hero')
51
+            // console.log(this.$store)
53 52
             // Clear the hero between pages
54 53
             this.$store.commit('CLEAR_HERO')
55 54
         },

+ 7
- 4
vue-theme/src/pages/index.vue 파일 보기

@@ -2,6 +2,9 @@
2 2
 <template lang="pug">
3 3
 .page--index.f-row.between
4 4
     article.f-grow
5
+        .f-row
6
+            h3(v-if="!allPagesLoaded ") loading...
7
+            .content(v-else-if="allPages['welcome']" v-html="allPages['welcome'].content")
5 8
         .f-row
6 9
             section(v-if="allEpisodesLoaded").shadow
7 10
                 router-link(:to="`./episodes`")
@@ -56,16 +59,16 @@ export default {
56 59
 .page--index
57 60
     article
58 61
         .f-row
59
-            &:nth-of-type(2)
62
+            &:nth-of-type(3)
60 63
                 margin: $ms-0 0
61 64
         section
62 65
             flex-grow: 1
63
-            &:nth-of-type(1)
66
+            &:nth-of-type(2)
64 67
                 flex-grow: 3
65
-            &:nth-of-type(2), &:nth-of-type(3)
68
+            &:nth-of-type(3), &:nth-of-type(4)
66 69
                 flex-grow: 1
67 70
                 margin: 0 0 0 $ms-0
68
-            &:nth-of-type(4), &:nth-of-type(5)
71
+            &:nth-of-type(5), &:nth-of-type(6)
69 72
                 flex-grow: 4
70 73
     footer
71 74
         img

+ 2
- 2
vue-theme/src/pages/list.vue 파일 보기

@@ -93,7 +93,7 @@ export default {
93 93
             if(this.type !== sort || !Object.values(sortTypes).includes(sort)) sort = null
94 94
             
95 95
             // Don't dispatch if there's no type
96
-            if(this.type) {
96
+            if(this.type && this.dispatchName) {
97 97
                 this.$store.dispatch(this.dispatchName, sort)
98 98
                 this.checkAndSetHero()
99 99
             }
@@ -102,7 +102,7 @@ export default {
102 102
             const page = this.allPages[this.type]
103 103
             if(!page) return
104 104
             let json = { url: page.featured, heroType: 'image' }
105
-            if(page.hero && JSON.parse(page.hero).url) {
105
+            if(page.hero && JSON.parse(page.hero) && JSON.parse(page.hero).url) {
106 106
                 json = JSON.parse(page.hero)
107 107
                 json.heroType = 'video'
108 108
             }

+ 1
- 1
vue-theme/src/pages/single.vue 파일 보기

@@ -145,7 +145,7 @@ export default {
145 145
         checkAndSetHero(post) {
146 146
             if(!post) return
147 147
             let json = { url: post.featured, heroType: 'image' }
148
-            if(post.hero && JSON.parse(post.hero).url) {
148
+            if(post.hero && JSON.parse(post.hero) && JSON.parse(post.hero).url) {
149 149
                 json = JSON.parse(post.hero)
150 150
                 json.heroType = 'video'
151 151
             }

+ 1
- 1
vue-theme/src/store/index.js 파일 보기

@@ -32,7 +32,7 @@ const state = {
32 32
 const mutations = {
33 33
     SET_HERO(state, hero) {
34 34
         if (!hero) return
35
-        console.log(hero)
35
+
36 36
         if (hero.url) {
37 37
             state.hero.text = state.hero.url = hero.url
38 38
             state.hero.type = hero.type

Loading…
취소
저장