diff --git a/src/models/FBX.js b/src/models/FBX.js index 99ce9e7..7639efa 100644 --- a/src/models/FBX.js +++ b/src/models/FBX.js @@ -1,7 +1,8 @@ +import { defineComponent } from 'vue'; import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader.js'; import Model from './Model.js'; -export default { +export default defineComponent({ extends: Model, props: { src: String, @@ -12,4 +13,4 @@ export default { this.onLoad(fbx); }, this.onProgress, this.onError); }, -}; +}); diff --git a/src/models/GLTF.js b/src/models/GLTF.js index 7666ee6..b5c0bd2 100644 --- a/src/models/GLTF.js +++ b/src/models/GLTF.js @@ -1,7 +1,8 @@ +import { defineComponent } from 'vue'; import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'; import Model from './Model.js'; -export default { +export default defineComponent({ extends: Model, props: { src: String, @@ -12,4 +13,4 @@ export default { this.onLoad(gltf.scene); }, this.onProgress, this.onError); }, -}; +}); diff --git a/src/models/Model.js b/src/models/Model.js index 267b6ff..ff5d1b2 100644 --- a/src/models/Model.js +++ b/src/models/Model.js @@ -1,6 +1,7 @@ +import { defineComponent } from 'vue'; import Object3D from '../core/Object3D.js'; -export default { +export default defineComponent({ extends: Object3D, emits: ['load', 'progress', 'error'], data() { @@ -21,4 +22,4 @@ export default { this.$emit('error', error); }, }, -}; +});