king2088 / vue-3d-loader

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

can't add to nextcloud app #47

Closed aminvandh closed 1 year ago

aminvandh commented 1 year ago

I tried to add this into nextcloud project but it leaves me with warnings: WARNING in ./node_modules/vue-3d-loader/dist/vue-3d-loader.esm.js 42057:13-22 export 'openBlock' (imported as 'openBlock') was not found in 'vue' (possible exports:

WARNING in ./node_modules/vue-3d-loader/dist/vue-3d-loader.esm.js 42057:26-44 export 'createElementBlock' (imported as 'createElementBlock') was not found in 'vue' (possible exports:

WARNING in ./node_modules/vue-3d-loader/dist/vue-3d-loader.esm.js 42062:8-26 export 'createElementVNode' (imported as 'createElementVNode') was not found in 'vue' (possible exports:

king2088 commented 1 year ago

What vue-3d-loader version and nuxt version are you using? Use vue-3d-loader in nuxt2, you need install version 1.2.14 or other 1.x.x version. If you use nuxt2, example:

- Add the plugin to `nuxt.config.js`
```js
plugins: [
    { src: '@/plugins/vue-3d-loader-plugin', mode: 'client' }
  ],
aminvandh commented 1 year ago

Thanks, nextcloud uses Vue 2.7 and i don't have nuxt installed. still can load model with new vue project (v3.*) but not with this one

king2088 commented 1 year ago

You can try install vue-3d-loader version 1.2.14 in your nextcloud project. In the vue2 must use vue-3d-loader@1.x.x, in the vue3 use vue-3d-loader@2.x.x.

aminvandh commented 1 year ago

Thanks for help, errors are gone, but nothing shows up, its maybe my issue. src/main.js:

import App from './App' import vue3dLoader from 'vue-3d-loader' import Vue from 'vue' // eslint-disable-next-line __webpack_public_path__ = generateFilePath(appName, '', 'js/')

Vue.mixin({ methods: { t, n } }) Vue.use(vue3dLoader); export default new Vue({ el: "#content", render: h => h(App),

})

i put *.glb file in img, and use : <vue3dLoader :file-path="'../img/house.glb'" />

king2088 commented 1 year ago

Thanks for help, errors are gone, but nothing shows up, its maybe my issue. src/main.js:

import App from './App' import vue3dLoader from 'vue-3d-loader' import Vue from 'vue' // eslint-disable-next-line __webpack_public_path__ = generateFilePath(appName, '', 'js/')

Vue.mixin({ methods: { t, n } }) Vue.use(vue3dLoader); export default new Vue({ el: "#content", render: h => h(App),

})

Set height/width or scale. More info you can view document https://king2088.github.io/vue-3d-loader-docs/guide/api.html

king2088 commented 1 year ago

Your glb file must be accessible through a url. It is recommended to place the file in the public or static directory.

aminvandh commented 1 year ago

Here is debug console HhBq3Sj.md.png

king2088 commented 1 year ago

If your glb file in the public directory, the filePath don't add '/public/', look like this:

<vue-3d-loader filePath="/house.glb"/>
aminvandh commented 1 year ago

path is fine, i think its a router issue, which won't let that access

king2088 commented 1 year ago

path is fine, i think its a router issue, which won't let that access

Your glb file http url is 404(not found),the url not access, so you need a glb file path that can be accessed through a url. In the vue project project, the public directory is not processed by webpack, if your build your front-end project, the public directory all files is in root directory. So in the vue your want access your public directory files, you can directly access the files in the root directory. if you have a file in public shch as public/a.glb, you can use http://localhost:8080/a.glb, don't use http://localhost:8080/public/a.glb. So your vue file look like this:

<vue-3d-loader filePath="/a.glb"/>

Of course, most of the time, your glb files are stored directly on an http server, so you can simply place your glb files on another http server that can be accessed through a url, such as using http server locally.

king2088 commented 1 year ago
aminvandh commented 1 year ago

other tags like <img work well with files in any directory.

aminvandh commented 1 year ago

thank you BTW, i used external link to point and it worked well HhCnxEP.md.png