1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 12:22:03 +08:00
trois/src/core/Camera.ts

23 lines
599 B
TypeScript
Raw Normal View History

2021-04-19 07:53:25 +08:00
import { defineComponent, inject } from 'vue'
2021-04-20 01:37:11 +08:00
import { ThreeInterface } from './useThree'
2021-04-19 07:53:25 +08:00
// import Object3D from './Object3D'
export default defineComponent({
2021-04-19 07:53:25 +08:00
// TODO: eventually extend Object3D
// extends: Object3D,
2021-04-19 08:17:56 +08:00
// don't work with typescript, bug ?
// but works in sub components (injection, not typescript)
inject: ['three'],
2021-04-19 07:53:25 +08:00
setup() {
2021-04-19 08:17:56 +08:00
// this works with typescript in sub component
// but setup is not called
2021-04-19 07:53:25 +08:00
const three = inject('three') as ThreeInterface
return { three }
},
render() {
2021-04-16 07:56:52 +08:00
return this.$slots.default ? this.$slots.default() : []
},
2021-04-16 07:56:52 +08:00
})