83d8035dc2
* root + server * frontend * frontend-2 * dui3 * dui3 * tailwind theme * ui-components * preview service * viewer * viewer-sandbox * fileimport-service * webhook service * objectloader * shared * ui-components-nuxt * WIP full config * WIP full linter * eslint projectwide util * minor fix * removing redundant ci * clean up test errors * fixed prettier formatting * CI improvements * TSC lint fix * 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader * removed unnecessary void --------- Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
33 lines
732 B
Vue
33 lines
732 B
Vue
<template>
|
|
<div ref="rendererparent" class="absolute w-full h-full"></div>
|
|
</template>
|
|
<script setup lang="ts">
|
|
import { useInjectedViewer } from '~~/lib/viewer/composables/setup'
|
|
|
|
const rendererparent = ref<HTMLElement>()
|
|
const {
|
|
instance: viewer,
|
|
container,
|
|
init: { promise: isInitializedPromise }
|
|
} = useInjectedViewer()
|
|
|
|
onMounted(async () => {
|
|
if (!import.meta.client) return
|
|
|
|
await isInitializedPromise
|
|
container.style.display = 'block'
|
|
rendererparent.value?.appendChild(container)
|
|
|
|
viewer.resize()
|
|
// Not needed
|
|
// viewer.cameraHandler.onWindowResize()
|
|
})
|
|
|
|
onBeforeUnmount(() => {
|
|
if (!import.meta.client) return
|
|
container.style.display = 'none'
|
|
|
|
document.body.appendChild(container)
|
|
})
|
|
</script>
|