From 56f049a070f777c37abfc44f3d18773e7a5af51a Mon Sep 17 00:00:00 2001 From: Sander Moolin Date: Tue, 25 May 2021 16:57:37 -0400 Subject: [PATCH 1/2] Fix build error --- src/App.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 89e5f94..45a4c8e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -21,7 +21,9 @@ export default defineComponent({ const box = this.$refs.box as MeshPublicInterface if (renderer && box) { renderer.onBeforeRender(() => { - box.mesh.rotation.x += 0.01 + if (box.mesh){ + box.mesh.rotation.x += 0.01 + } }) } }, From a57c44d968e8fa3723e7cce8c93e5757ead9139d Mon Sep 17 00:00:00 2001 From: Sander Moolin Date: Wed, 26 May 2021 16:02:46 -0400 Subject: [PATCH 2/2] update build fix --- src/App.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/App.vue b/src/App.vue index 45a4c8e..f5aeb96 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,12 +18,10 @@ export default defineComponent({ components: { Box, Camera, LambertMaterial, PointLight, Renderer, Scene }, mounted() { const renderer = this.$refs.renderer as RendererPublicInterface - const box = this.$refs.box as MeshPublicInterface - if (renderer && box) { + const mesh = (this.$refs.box as MeshPublicInterface).mesh + if (renderer && mesh) { renderer.onBeforeRender(() => { - if (box.mesh){ - box.mesh.rotation.x += 0.01 - } + mesh.rotation.x += 0.01 }) } },