king2088 / vue-3d-loader

VueJS and threeJS 3d viewer plugin
https://king2088.github.io/vue-3d-loader-docs
MIT License
222 stars 37 forks source link

can't load stl model or other #119

Open yh08200 opened 2 months ago

yh08200 commented 2 months ago

my code is this: <template> <vue3dLoader filePath="/models/stl/colored.stl" :cameraPosition="{ x: 1, y: -5, z: -20 }" :height="350" /> </template>

and the stl model is in [/public/models/stl/] like this

but when run it will show under error

vue-3d-loader.esm.js:41016 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'style') at setContainerElementStyle (vue-3d-loader.esm.js:41016:12) at init (vue-3d-loader.esm.js:40970:7) at vue-3d-loader.esm.js:40856:7 at runtime-core.esm-bundler.js:2884:88 at callWithErrorHandling (runtime-core.esm-bundler.js:195:19) at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:202:17) at hook.weh.hook.weh (runtime-core.esm-bundler.js:2864:19) at flushPostFlushCbs (runtime-core.esm-bundler.js:370:26) at flushJobs (runtime-core.esm-bundler.js:408:5)

main.js?t=1714304877305:11 [Vue warn]: Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function. at <Vue3dLoader filePath="/models/stl/colored.stl" cameraPosition= {x: 1, y: -5, z: -20} height=350 > at <Qry onVnodeUnmounted=fn ref=Ref< undefined > > at at

king2088 commented 2 months ago

What's version for your vue and vue-3d-loader?

yh08200 commented 2 months ago

What's version for your vue and vue-3d-loader?

"dependencies": { "element-plus": "^2.6.2", "mitt": "^3.0.1", "vue": "^3.2.8", "vue-3d-loader": "^2.2.4", "vue-router": "^4.3.0" }, "devDependencies": { "@vitejs/plugin-vue": "^1.6.0", "@vue/compiler-sfc": "^3.2.6", "vite": "^2.5.2" }

king2088 commented 2 months ago

What's version for your vue and vue-3d-loader?

"dependencies": { "element-plus": "^2.6.2", "mitt": "^3.0.1", "vue": "^3.2.8", "vue-3d-loader": "^2.2.4", "vue-router": "^4.3.0" }, "devDependencies": { "@vitejs/plugin-vue": "^1.6.0", "@vue/compiler-sfc": "^3.2.6", "vite": "^2.5.2" }

Unable to reproduce, please check your local code and reference online code( https://king2088.github.io/vue-3d-loader-docs/guide/example/load-a-model.html