manifest/nuxt/components/DodajPojem.vue

29 lines
603 B
Vue
Raw Normal View History

<script setup="setup">
const { etherpadApiUrl } = useEtherpadApi()
const prikazi = ref(false)
const revisionId = ref(null)
const dodajPojem = async () => {
revisionId.value = crypto.randomUUID()
// Ustvari nov, prazen pad
const padId = revisionId.value
const resp = await $fetch(`${etherpadApiUrl}/createPad?padID=${padId}`)
prikazi.value = true
}
</script>
2023-06-15 20:45:38 +02:00
<template>
<div>
<div class="gumb" @click="dodajPojem()">
2023-06-15 20:45:38 +02:00
Dodaj pojem
</div>
<section class="pojem" v-if="prikazi">
<PojemForm :pojem="{}" :revisionId="revisionId" />
</section>
</div>
2023-06-15 20:45:38 +02:00
</template>