Texture = new THREE.TextureLoader (). Load () introduces texture, which piece in the vue scaffolding should the picture be placed on?

1, I introduced threejs, into vue-cli to use local images as textures, but texture has always been wrong. How should I write the path that texture.image has been underfine,? -sharp-sharp-sharp problem description

I wrote the threejs code in mounted to create a cube model, which has been rendered pure black because I can"t read the picture.

Dec.02,2021

var texture = new THREE.TextureLoader (). Load (require ('.. /.. / static/img/grass.jpg'));
in require


new THREE.TextureLoader().load('../../../static/img/dog.jpeg', texture => {
    mesh.material = new THREE.MeshBasicMaterial({map: texture});
    renderer.clear();
    renderer.render(scene, camera);
});
Put the

picture under the static folder, and the effect is as shown below.


static

Menu