mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 20:32:02 +08:00
27 lines
400 B
JavaScript
27 lines
400 B
JavaScript
import { Scene } from 'three';
|
|
|
|
export default {
|
|
props: {
|
|
id: String,
|
|
},
|
|
setup () {
|
|
const scene = new Scene();
|
|
return { scene };
|
|
},
|
|
inject: ['three'],
|
|
provide() {
|
|
return {
|
|
scene: this.scene,
|
|
};
|
|
},
|
|
mounted() {
|
|
this.three.scene = this.scene;
|
|
},
|
|
render() {
|
|
if (this.$slots.default) {
|
|
return this.$slots.default();
|
|
}
|
|
return [];
|
|
},
|
|
};
|