mirror of
https://github.com/troisjs/trois.git
synced 2024-11-23 20:02:32 +08:00
defineComponent for model loaders (#10)
This commit is contained in:
parent
98c74aa1c4
commit
2dae67458f
@ -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);
|
||||
},
|
||||
};
|
||||
});
|
||||
|
@ -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);
|
||||
},
|
||||
};
|
||||
});
|
||||
|
@ -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);
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user