manifest/nuxt/components/EtherpadTextarea.vue

26 lines
605 B
Vue
Raw Normal View History

2023-09-30 20:14:02 +02:00
<script setup="setup">
import { ref } from 'vue'
const { etherpadUrl, etherpadPrefix } = useRuntimeConfig().public
const props = defineProps({
revisionId: String,
onLoad: Function
2023-09-30 20:14:02 +02:00
})
const embed = ref(null)
onMounted(() => {
// Ce ni revisionId propertyja, se random generira.
2023-09-30 20:14:02 +02:00
const uuid = props.revisionId ? props.revisionId : crypto.randomUUID()
const padUrl = `${etherpadUrl}p/${etherpadPrefix}${uuid}?showChat=false&showLineNumbers=false&toc=false`
embed.value.src = padUrl
})
</script>
<template>
<iframe ref="embed" class="etherpad-textarea" @load="props.onLoad" />
2023-09-30 20:14:02 +02:00
</template>