(wip) introduce routing

This commit is contained in:
Vri 🌈 2023-06-21 18:51:54 +02:00
parent 24782c2d08
commit 08e07f5963
Signed by: vrifox
GPG key ID: D40098E5B60B2197
18 changed files with 182 additions and 69 deletions

View file

@ -2,16 +2,20 @@
export default {
data() {
return {
menuEntries: this.mainMenuEntries,
entries: this.mainMenuEntries
}
},
}
}
</script>
<template>
<ul class="flex flex-row place-content-center">
<li class="p-2 place-content-center" v-for="(entry, i) of menuEntries" :key="i">
<a :href="entry.uri">{{ entry.name }}</a>
<li
class="p-2 place-content-center"
v-for="(entry, i) of entries"
:key="i"
>
<RouterLink :to="entry.uri">{{ entry.name }}</RouterLink>
</li>
</ul>
</template>

View file

@ -1,6 +1,4 @@
<script lang="ts">
import { type Papers } from './PaperList.vue'
export default {
updated() {
this.$emit('paperFilter', this.paperFilter)
@ -63,11 +61,11 @@ export default {
}
},
props: {
papers: Array<Papers>,
papers: Array<any>,
},
computed: {
paperOriginators() {
return [...new Set(this.papers?.map((paper: Papers) => paper.originator))].sort()
return [...new Set(this.papers?.map((paper: any) => paper.originator))].sort()
},
/* paperType() {
return this.paperTypes.filter((type) => type.key == )

View file

@ -1,31 +1,9 @@
<script lang="ts">
export type Papers = {
body: string
content: string
name: string
resolution: string
originator: string
paper_type: string
published_at: string
reference: string
url: string
}
import { type Papers } from '@/App.vue'
export default {
created() {
this.fetchData()
},
updated() {
this.$emit('papers', this.papers)
},
data() {
return {
apiUri: 'https://raw.githubusercontent.com/CodeforLeipzig/stadtratmonitor/master/input.json',
papers: [] as Papers[],
}
},
props: {
papers: Array<any>,
paperQuery: Object,
paperFilter: Object,
},
@ -52,9 +30,6 @@ export default {
},
},
methods: {
async fetchData() {
this.papers = await (await fetch(this.apiUri)).json()
},
openPaper() {
},