Skip to content

Commit

Permalink
feat(Lensflare): change exposed ref name
Browse files Browse the repository at this point in the history
  • Loading branch information
andretchen0 committed Sep 2, 2023
1 parent 6605eaa commit 9279cfe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/core/abstractions/Lensflare.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const props = withDefaults(
},
)
const groupRef = shallowRef<Lensflare>();
const lensflareRef = shallowRef<Lensflare>();
defineExpose({
value: groupRef,
value: lensflareRef,
});
const textureLoader = new THREE.TextureLoader();
Expand Down Expand Up @@ -214,12 +214,12 @@ const threeElements: LensflareElement = [];
const dispose = () => {
while (threeElements.length) threeElements.pop();
groupRef.value?.children.forEach((c: any) => { if ('dispose' in c) c.dispose(); });
groupRef.value?.remove(...groupRef.value.children);
lensflareRef.value?.children.forEach((c: any) => { if ('dispose' in c) c.dispose(); });
lensflareRef.value?.remove(...lensflareRef.value.children);
}
const onChange = () => {
if (groupRef.value) {
if (lensflareRef.value) {
const normalizedUserElements = (() => {
// NOTE: The user can either tweak the seeded lensflare or provide their own.
Expand Down Expand Up @@ -288,7 +288,7 @@ const onChange = () => {
}
onMounted(() => {
groupRef.value.add(threeLensflare);
lensflareRef.value.add(threeLensflare);
onChange();
})
Expand All @@ -301,5 +301,5 @@ watch(() => props.flare, onChange)
</script>

<template>
<TresGroup v-bind="$attrs" ref="groupRef"></TresGroup>
<TresGroup v-bind="$attrs" ref="lensflareRef"></TresGroup>
</template>

0 comments on commit 9279cfe

Please sign in to comment.