Open wslrj123 opened 8 months ago
What I am looking to achieve is roughly: 1.Import resources in the import statement import earth from '../assets/earth.png' 2.Then use it in the code
import earth from '../assets/earth.png'
let img = new Image(); img.src=earth
In this case, print value of earth is 'assets/earth.png', but my img cannot correctly read the path.
What I am looking to achieve is roughly: 1.Import resources in the import statement
import earth from '../assets/earth.png'
2.Then use it in the codeIn this case, print value of earth is 'assets/earth.png', but my img cannot correctly read the path.