manifest/nuxt/pages/manifest/dodaj.vue

47 lines
857 B
Vue
Raw Normal View History

2024-01-19 13:35:03 +01:00
<script setup="setup">
const { getRandomUUID } = useCrypto()
const { etherFetch } = useEtherpadApi()
const { poskrolaj } = useUi()
2024-01-19 13:35:03 +01:00
const route = useRoute()
const revisionId = ref(null)
2024-01-24 17:37:41 +01:00
const obrazec = ref(null)
2024-01-19 13:35:03 +01:00
revisionId.value = route.params.guid ? route.params.guid : getRandomUUID()
// Ustvari nov, prazen pad
// @TODO parameter za seranje linka?
const resp = await etherFetch('/createPad', {
padID: revisionId.value,
text: ''
})
2024-01-19 13:35:03 +01:00
2024-01-24 18:54:28 +01:00
const onZapri = () => { navigateTo('/manifest#skrol') }
2024-01-24 17:37:41 +01:00
onMounted(() => {
poskrolaj(obrazec.value)
2024-01-24 17:37:41 +01:00
})
2024-01-19 13:35:03 +01:00
</script>
<template>
2024-01-24 17:37:41 +01:00
<section class="okvir" ref="obrazec">
<PojemForm
:pojem="{ nov: true }"
:revisionId="revisionId"
zapriLabel="Nazaj"
:onZapri="onZapri" />
2024-01-19 13:35:03 +01:00
</section>
</template>
<style scoped>
2024-01-24 17:37:41 +01:00
section.okvir {
2024-01-19 13:35:03 +01:00
max-width: 608px;
}
form.pojem {
width: 100%;
}
</style>