Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add library to use with VueJs or React #29

Open
Kretzer6019 opened this issue Nov 18, 2022 · 3 comments
Open

Add library to use with VueJs or React #29

Kretzer6019 opened this issue Nov 18, 2022 · 3 comments

Comments

@Kretzer6019
Copy link

Hi!

I'm new with JS and i'm trying to add this library to work with VueJs or React.

I followed the steps using Javascript vanilla and it's worked perfectly, but when i tried to do the same thing using VueJs/React, it didn't work. Can you help me with that?

Oh, and congratulations for the project :)

@omrips
Copy link
Owner

omrips commented Nov 19, 2022

Hi, the plugin is not designed to be used with React/VueJS - but I'm quite sure it is possible to do it.
Can you show/send me your code and/or log?

@Kretzer6019
Copy link
Author

image
This is my .vue file. When i import in this way, my log shows this error. I tried to import on main.js file or directly on html, but it shows the same error:
image

@omrips
Copy link
Owner

omrips commented Nov 21, 2022

It maybe because some files are missing, try to load them manually (before stl_viewer.min.js )
parser.min.js
load_stl.min.js
webgl_detector.js
CanvasRenderer.js
OrbitControls.js
TrackballControls.js
Projector.js
three.min.js

add this parameter to the init line: load_three_files:false
should look like this:
var stl_viewer=new StlViewer(document.getElementById("stl_cont"), { load_three_files:false });

Hope that will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants