diff --git a/src/core/Camera.js b/src/core/Camera.js index 7df3346..19db0e2 100644 --- a/src/core/Camera.js +++ b/src/core/Camera.js @@ -1,6 +1,7 @@ +import { defineComponent } from 'vue'; // import Object3D from '../core/Object3D.js'; -export default { +export default defineComponent({ // TODO: eventually extend Object3D, for now: error 'injection "scene" not found' // because camera is a sibling of scene in Trois // extends: Object3D, @@ -8,4 +9,4 @@ export default { render() { return this.$slots.default ? this.$slots.default() : []; }, -}; +}); diff --git a/src/core/Group.js b/src/core/Group.js index 72a7129..874bb7b 100644 --- a/src/core/Group.js +++ b/src/core/Group.js @@ -1,7 +1,8 @@ +import { defineComponent } from 'vue'; import { Group } from 'three'; import Object3D from './Object3D.js'; -export default { +export default defineComponent({ name: 'Group', extends: Object3D, created() { @@ -9,4 +10,4 @@ export default { this.initObject3D(this.group); }, __hmrId: 'Group', -}; +}); diff --git a/src/core/Object3D.js b/src/core/Object3D.js index f9f8a31..c049583 100644 --- a/src/core/Object3D.js +++ b/src/core/Object3D.js @@ -1,7 +1,7 @@ -import { watch } from 'vue'; +import { defineComponent, watch } from 'vue'; import { bindProp } from '../tools'; -export default { +export default defineComponent({ name: 'Object3D', inject: ['three', 'scene', 'rendererComponent'], emits: ['created', 'ready'], @@ -65,4 +65,4 @@ export default { return this.$slots.default ? this.$slots.default() : []; }, __hmrId: 'Object3D', -}; +}); diff --git a/src/core/OrthographicCamera.js b/src/core/OrthographicCamera.js index c5bb443..e3acef7 100644 --- a/src/core/OrthographicCamera.js +++ b/src/core/OrthographicCamera.js @@ -1,9 +1,9 @@ +import { defineComponent, watch } from 'vue'; import { OrthographicCamera } from 'three'; -import { watch } from 'vue'; import { bindProp } from '../tools'; import Camera from './Camera.js'; -export default { +export default defineComponent({ extends: Camera, name: 'OrthographicCamera', inject: ['three'], @@ -31,4 +31,4 @@ export default { this.three.camera = this.camera; }, __hmrId: 'OrthographicCamera', -}; +}); diff --git a/src/core/PerspectiveCamera.js b/src/core/PerspectiveCamera.js index 0ece470..b221c1c 100644 --- a/src/core/PerspectiveCamera.js +++ b/src/core/PerspectiveCamera.js @@ -1,9 +1,9 @@ +import { defineComponent, watch } from 'vue'; import { PerspectiveCamera } from 'three'; -import { watch } from 'vue'; import { bindProp } from '../tools'; import Camera from './Camera.js'; -export default { +export default defineComponent({ extends: Camera, name: 'PerspectiveCamera', inject: ['three'], @@ -32,4 +32,4 @@ export default { this.three.camera = this.camera; }, __hmrId: 'PerspectiveCamera', -}; +}); diff --git a/src/core/Raycaster.js b/src/core/Raycaster.js index 3e57b0d..2b50825 100644 --- a/src/core/Raycaster.js +++ b/src/core/Raycaster.js @@ -1,6 +1,7 @@ +import { defineComponent } from 'vue'; import usePointer from './usePointer'; -export default { +export default defineComponent({ name: 'Raycaster', inject: ['three', 'rendererComponent'], props: { @@ -45,4 +46,4 @@ export default { return []; }, __hmrId: 'Raycaster', -}; +}); diff --git a/src/core/Renderer.js b/src/core/Renderer.js index c5adb2f..93ee506 100644 --- a/src/core/Renderer.js +++ b/src/core/Renderer.js @@ -1,7 +1,7 @@ -import { h } from 'vue'; +import { defineComponent, h } from 'vue'; import useThree from './useThree'; -export default { +export default defineComponent({ name: 'Renderer', props: { antialias: Boolean, @@ -77,4 +77,4 @@ export default { return h('canvas', {}, this.$slots.default()); }, __hmrId: 'Renderer', -}; +}); diff --git a/src/core/Scene.js b/src/core/Scene.js index f757706..faab7ed 100644 --- a/src/core/Scene.js +++ b/src/core/Scene.js @@ -1,7 +1,7 @@ +import { defineComponent, watch } from 'vue'; import { Scene, Color } from 'three'; -import { watch } from 'vue'; -export default { +export default defineComponent({ name: 'Scene', inject: ['three'], props: { @@ -32,4 +32,4 @@ export default { return this.$slots.default ? this.$slots.default() : []; }, __hmrId: 'Scene', -}; +});