mirror of
https://github.com/troisjs/trois.git
synced 2024-11-23 20:02:32 +08:00
Models: add before-load event
This commit is contained in:
parent
f109069d9f
commit
07064c32a3
@ -6,6 +6,7 @@ export default defineComponent({
|
||||
extends: Model,
|
||||
created() {
|
||||
const loader = new FBXLoader()
|
||||
this.$emit('before-load', loader)
|
||||
loader.load(this.src, (fbx) => {
|
||||
this.onLoad(fbx)
|
||||
}, this.onProgress, this.onError)
|
||||
|
@ -6,6 +6,7 @@ export default defineComponent({
|
||||
extends: Model,
|
||||
created() {
|
||||
const loader = new GLTFLoader()
|
||||
this.$emit('before-load', loader)
|
||||
loader.load(this.src, (gltf) => {
|
||||
this.onLoad(gltf.scene)
|
||||
}, this.onProgress, this.onError)
|
||||
|
@ -4,7 +4,7 @@ import Object3D from '../core/Object3D'
|
||||
|
||||
export default defineComponent({
|
||||
extends: Object3D,
|
||||
emits: ['load', 'progress', 'error'],
|
||||
emits: ['load', 'progress', 'error', 'before-load'],
|
||||
props: {
|
||||
src: { type: String, required: true },
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user