mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
23 lines
599 B
TypeScript
23 lines
599 B
TypeScript
import { defineComponent, inject } from 'vue'
|
|
import { ThreeInterface } from './useThree'
|
|
// import Object3D from './Object3D'
|
|
|
|
export default defineComponent({
|
|
// TODO: eventually extend Object3D
|
|
// extends: Object3D,
|
|
|
|
// don't work with typescript, bug ?
|
|
// but works in sub components (injection, not typescript)
|
|
inject: ['three'],
|
|
|
|
setup() {
|
|
// this works with typescript in sub component
|
|
// but setup is not called
|
|
const three = inject('three') as ThreeInterface
|
|
return { three }
|
|
},
|
|
render() {
|
|
return this.$slots.default ? this.$slots.default() : []
|
|
},
|
|
})
|