We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I extract meshes/groups into Vue components, I can't seem to be able to use refs on the custom component.
Example:
Thing.vue
<template> <Group> <Box> <LambertMaterial color="#222222" /> </Box> </Group> </template> <script setup> import { Group, Box } from 'troisjs' </script>
App.vue
<template> <Renderer ref="rendererC" antialias :orbit-ctrl="{ enableDamping: true }" resize="window" shadow> <Camera ref="camera" :position="{ x: 10, y: 10, z: 10 }" /> <Scene> <Thing ref="thing" /> </Scene> </Renderer> </template> <script setup> import { ref, onMounted } from 'vue' import { Renderer, Camera, Scene } from 'troisjs' import Thing from './components/thing.vue' const thing = ref() onMounted(() => { console.log(thing.value) // This seems to be a complete empty ref with a `__v_skip` attribute }) </script>
The text was updated successfully, but these errors were encountered:
Yup ran into the same issue as well
Sorry, something went wrong.
You should try :
<template> <Group> <Box ref="box"> <BasicMaterial color="#222222" /> </Box> </Group> </template> <script setup> import { ref } from 'vue' import { Group, Box, BasicMaterial } from 'troisjs' const box = ref() defineExpose({ box }) </script>
onMounted(() => { console.log(thing.value.box) })
https://vuejs.org/api/sfc-script-setup.html#defineexpose
klevron
No branches or pull requests
When I extract meshes/groups into Vue components, I can't seem to be able to use refs on the custom component.
Example:
Thing.vue
App.vue
The text was updated successfully, but these errors were encountered: