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

24 lines
346 B
JavaScript
Raw Normal View History

2020-09-14 22:57:11 +08:00
import { Scene } from 'three';
export default {
2020-09-15 04:53:30 +08:00
props: {
id: String,
},
setup () {
2020-09-14 22:57:11 +08:00
const scene = new Scene();
return { scene };
},
2020-09-15 04:53:30 +08:00
inject: ['three'],
2020-09-14 22:57:11 +08:00
provide() {
return {
scene: this.scene,
};
},
mounted() {
this.three.scene = this.scene;
},
render() {
return this.$slots.default();
},
};