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 },