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'
|
|
|
|
|
2021-04-04 04:19:57 +08:00
|
|
|
export default defineComponent({
|
2021-04-19 07:53:25 +08:00
|
|
|
// TODO: eventually extend Object3D
|
2021-03-22 21:30:25 +08:00
|
|
|
// 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 }
|
|
|
|
},
|
2021-03-22 21:30:25 +08:00
|
|
|
render() {
|
2021-04-16 07:56:52 +08:00
|
|
|
return this.$slots.default ? this.$slots.default() : []
|
2021-03-22 21:30:25 +08:00
|
|
|
},
|
2021-04-16 07:56:52 +08:00
|
|
|
})
|