1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00
This commit is contained in:
Kevin Levron 2021-04-19 02:17:56 +02:00
parent f81c9a6996
commit 971f37e29b
3 changed files with 7 additions and 4 deletions

View File

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

View File

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

View File

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