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

23 lines
376 B
JavaScript
Raw Normal View History

2020-09-14 22:57:11 +08:00
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();
},
};