From 971f37e29b6d0a675f3debb8e9f48c8985f1aa3c Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Mon, 19 Apr 2021 02:17:56 +0200 Subject: [PATCH] wip --- src/core/Camera.ts | 9 +++++++-- src/core/OrthographicCamera.ts | 1 - src/core/PerspectiveCamera.ts | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/Camera.ts b/src/core/Camera.ts index 7836a34..2a5c6a8 100644 --- a/src/core/Camera.ts +++ b/src/core/Camera.ts @@ -9,9 +9,14 @@ interface ThreeInterface { export default defineComponent({ // TODO: eventually extend Object3D // extends: Object3D, - // inject: ['three'], // don't work with typescript, bug ? + + // don't work with typescript, bug ? + // but works in sub components (injection, not typescript) + inject: ['three'], + setup() { - // this works in sub component ?? + // this works with typescript in sub component + // but setup is not called const three = inject('three') as ThreeInterface return { three } }, diff --git a/src/core/OrthographicCamera.ts b/src/core/OrthographicCamera.ts index 0d72c47..f66ea59 100644 --- a/src/core/OrthographicCamera.ts +++ b/src/core/OrthographicCamera.ts @@ -6,7 +6,6 @@ import Camera from './Camera' export default defineComponent({ extends: Camera, name: 'OrthographicCamera', - inject: ['three'], props: { left: { type: Number, default: -1 }, right: { type: Number, default: 1 }, diff --git a/src/core/PerspectiveCamera.ts b/src/core/PerspectiveCamera.ts index a353cc2..b37e2b5 100644 --- a/src/core/PerspectiveCamera.ts +++ b/src/core/PerspectiveCamera.ts @@ -6,7 +6,6 @@ import Camera from './Camera' export default defineComponent({ extends: Camera, name: 'PerspectiveCamera', - inject: ['three'], props: { aspect: { type: Number, default: 1 }, far: { type: Number, default: 2000 },