manifest/nuxt/components/PojemForm.vue

51 lines
1.1 KiB
Vue
Raw Normal View History

2023-06-15 20:45:38 +02:00
<script setup="setup">
const { etherpadUrl, etherpadPrefix } = useRuntimeConfig().public
2023-06-15 20:45:38 +02:00
const store = usePojmiStore()
const props = defineProps({
naslov: String,
revisionId: String
2023-06-15 20:45:38 +02:00
})
//const pojem = computed(() => store.pojmi[props.naslov])
//await store.naloziPojme()
// const UREJAM = !!pojem.value
const UREJAM = false
let naslov = ''
let tekst = ''
let email = ''
const oddajPredlog = data => {
console.log('oddajam predlog!', naslov, tekst, email)
store.ustvariPojem(data)
}
const etherNalozen = ev => {
window.location.hash = props.revisionId
}
2023-06-15 20:45:38 +02:00
</script>
<template>
<section class="pojem">
<div v-if="UREJAM">UREJAM</div>
<form class="pojem" @submit.prevent="oddajPredlog">
<label for="naslov">Naslov</label>
<input name="naslov" type="text" v-model="naslov">
<label for="tekst">Besedilo</label>
<EtherpadTextarea :onLoad="etherNalozen" :revisionId="props.revisionId" />
2023-06-15 20:45:38 +02:00
<label for="email">E-poštni naslov</label>
<input name="email" type="email" v-model="email">
<input type="submit" value="Predlagaj">
</form>
</section>
</template>