Summary of issues in Nuxt3 project - picture not showing

Sometimes the image paths are stitched together according to the data returned by the background. In the nuxt project, the files under assets will be packaged and compiled. :src=" " ~/assets/img/${item['xxx']}.pngLooking at the image address will become /_Nuxt/XXX. It is indeed possible to add /_Nuxt/ when developing locally, but after packaging and publishing, the images will not be found. At present, there are two solutions found
: 1. Throw the corresponding picture on the server, and the picture address uses the network address http//www.
2. Put the picture to be matched under public (nuxt3 is public, not static). Create a new img file under the public file, put pictures in it, use: src=" /img/${item['xxx']}.png"

Guess you like

Origin blog.csdn.net/qq_38661597/article/details/129439102