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

22 lines
528 B
TypeScript
Raw Normal View History

2021-04-19 07:53:25 +08:00
import { Camera } from 'three'
import { defineComponent, inject } from 'vue'
// import Object3D from './Object3D'
interface ThreeInterface {
camera?: Camera
}
export default defineComponent({
2021-04-19 07:53:25 +08:00
// TODO: eventually extend Object3D
// extends: Object3D,
2021-04-19 07:53:25 +08:00
// inject: ['three'], // don't work with typescript, bug ?
setup() {
// this works in sub component ??
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
})