Nekaj popravkov, pedenanje dodajanja novega pojma

pull/42/head
Jurij Podgoršek 2024-01-17 20:37:09 +01:00 committed by Lio Novelli
parent c79472379d
commit afe0878f6d
3 changed files with 16 additions and 6 deletions

View File

@ -21,6 +21,8 @@ const dodajPojem = async () => {
<div class="gumb" @click="dodajPojem()">
Dodaj pojem
</div>
<PojemForm v-if="prikazi" :revisionId="revisionId" />
<section class="pojem" v-if="prikazi">
<PojemForm :pojem="{}" :revisionId="revisionId" />
</section>
</div>
</template>

View File

@ -12,7 +12,6 @@ const props = defineProps({
const pojem = computed(() => store.pojmi[props.naslov])
const revisionId = computed(() => pojem.value.id)
const pojemId = computed(() => 'pojem-' + revisionId.value)
await store.naloziPojme()
@ -41,7 +40,7 @@ onMounted(() => {
</script>
<template>
<section class="pojem" :key="pojemId" ref="container">
<section class="pojem" ref="container">
<div>
<h2>{{ pojem.naslov }}</h2>
<div class="tekst" v-html="pojem.tekst" />

View File

@ -11,6 +11,15 @@ await store.naloziPojme()
<Pojem naslov="Jadran potem" />
<Pojem naslov="JUGA 2023" />
-->
<Pojem v-for="pojem in Object.keys(store.pojmi)" :naslov="pojem" />
<Pojem
v-for="pojem in Object.keys(store.pojmi)"
:naslov="pojem"
:key="store.pojmi[pojem].id" />
</template>
<style scoped>
DodajPojem {
float: right
}
</style>