Benjamin Kornblum hai 5 meses
pai
achega
8a855acdd1

+ 4 - 5
src/components/NavigationComponent.vue

@@ -73,12 +73,12 @@ nav a:first-of-type {
     import {loadDynamicPages} from '@/router'
     import { useI18n } from 'vue-i18n'
     import { useRoute } from 'vue-router'
+import type { FooterLink } from '@/types/footer-link'
 
     export default {
         data () {
             return {
-            links: [] as Array<any>,
-            error: null as any,
+            links: [] as Array<FooterLink>,
             }
         },
         setup(){
@@ -105,15 +105,14 @@ nav a:first-of-type {
             await useTimelineStore().setLocale(locale)
             await useComponentStore().setLocale(locale)
             loadDynamicPages(pageStore.pages)
-            const oldLink = this.footerLinksStroe.getLinkByLabel(this.route.name as string) as any
+            const oldLink = this.footerLinksStroe.getLinkByLabel(this.route.name as string) as FooterLink
             this.links = await this.footerLinksStroe.getLinks(locale)
             if(oldLink){
-              const newLink = this.footerLinksStroe.getLinkByLabel(oldLink.localizations[0].Label) as any
+              const newLink = this.footerLinksStroe.getLinkByLabel(oldLink.localizations[0].Label) as FooterLink
               setTimeout(() => {this.$router.push(newLink.page.path)}, 100)
             }
           }
         }
-
     }
 </script>
 

+ 3 - 3
src/components/TimelineComponent.vue

@@ -5,7 +5,7 @@
               <p :class="`text-${timeline.posittion}`">{{moment(timeline.date).format("DD.MMM.YYYY HH:mm")}}</p>
               <h2>{{timeline.label}}</h2>
               <p>{{timeline.discription}}</p>
-              <Map v-if="timeline.mapQuery" :q="timeline.mapQuery"/>
+              <MapComponent v-if="timeline.mapQuery" :q="timeline.mapQuery" />
             </div>
         </div>
     </div>
@@ -15,10 +15,10 @@
    import { useTimelineStore } from '@/stores/timeline'
    import { useI18n } from 'vue-i18n'
    import moment from 'moment'
-   import Map from './MapComponent.vue'
+   import MapComponent from './MapComponent.vue'
 
     export default {
-      components:{Map},
+      components:{MapComponent},
       setup(){
         const timelineStore = useTimelineStore()
           const { t } = useI18n({

+ 1 - 1
src/stores/pages.ts

@@ -10,7 +10,7 @@ export const usePageStore = defineStore('pages', {
   }),
 
   actions: {
-    getPageByTitle(title: string) {
+    getPageByTitle(title: string): Page | undefined {
       return this.pages.find((page) => page.Title === title)
     },
     async setLocale(locale: string) {

+ 0 - 1
src/types/component.ts

@@ -8,5 +8,4 @@ export interface Component {
   bg: boolean
   type: "component-dark" | "component-light";
   locale: string;
-
 }

+ 3 - 0
src/types/footer-link.ts

@@ -4,4 +4,7 @@ export interface FooterLink {
   page: {
     path: string;
   };
+  localizations: Array<{
+    Label: string;
+  }>;
 }

+ 7 - 6
src/views/PageView.vue

@@ -1,15 +1,16 @@
 <script lang="ts">
-   import { usePageStore } from '../stores/pages'
-   import Content from '@/components/ContentComponent.vue'
+   import { usePageStore } from '@/stores/pages'
+   import ContentComponent from '@/components/ContentComponent.vue'
+   import type { Page } from '@/types/page'
    import { useRoute } from 'vue-router'
     export default {
         name: 'PageView',
-        components:{
-            Content
+        components: {
+            ContentComponent
         },
         data () {
             return {
-              page: null as any,
+              page: undefined as Page | undefined,
             }
         },
         setup() {
@@ -35,7 +36,7 @@
             <div class="component component-bg-top"> </div>
             <div class="component component-text">
                 <h1> {{ page?.Title }}</h1>
-                <Content :jsonContent="page?.Content"/>
+                <ContentComponent :jsonContent="page?.Content"/>
             </div>
             <div class="component component-bg-bottom"> </div>
         </div>