(wip) introduce routing
This commit is contained in:
parent
24782c2d08
commit
08e07f5963
18 changed files with 182 additions and 69 deletions
|
@ -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>
|
|
@ -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 == )
|
||||
|
|
|
@ -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() {
|
||||
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue