manifest/nuxt/components/EtherpadTextarea.vue

25 lines
540 B
Vue

<script setup="setup">
import { ref } from 'vue'
const { etherpadUrl, etherpadPrefix } = useRuntimeConfig().public
const props = defineProps({
revisionId: String
})
const embed = ref(null)
onMounted(() => {
const uuid = props.revisionId ? props.revisionId : crypto.randomUUID()
const padUrl = `${etherpadUrl}p/${etherpadPrefix}${uuid}?showChat=false&showLineNumbers=false&toc=false`
embed.value.src = padUrl
window.location.hash = uuid
})
</script>
<template>
<iframe ref="embed" class="etherpad-textarea" />
</template>