mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 12:22:03 +08:00
23 lines
376 B
JavaScript
23 lines
376 B
JavaScript
|
import { Scene } from 'three';
|
||
|
|
||
|
export default {
|
||
|
emits: ['scene-ready'],
|
||
|
inject: ['three'],
|
||
|
setup (props) {
|
||
|
const scene = new Scene();
|
||
|
return { scene };
|
||
|
},
|
||
|
provide() {
|
||
|
return {
|
||
|
scene: this.scene,
|
||
|
};
|
||
|
},
|
||
|
mounted() {
|
||
|
this.three.scene = this.scene;
|
||
|
this.$emit('scene-ready');
|
||
|
},
|
||
|
render() {
|
||
|
return this.$slots.default();
|
||
|
},
|
||
|
};
|