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

Bug: 引用当前文件夹下的图片,但是最终路径变成了public下的路径 #5174

Closed
5 tasks done
RanMaoting opened this issue Dec 18, 2024 · 1 comment
Closed
5 tasks done

Comments

@RanMaoting
Copy link

Version

Vben Admin V5

Describe the bug?

如图,使用相对路径引用一张图片背景,发现并没有显示,在devtools里面查看,发现路径变成了public下的路径
image
image
如果使用img标签就能正常显示,
查询历史issues感觉应该是vite-plugin-html造成的问题,但是和以前的问题感觉又不太一样

Reproduction

/

System Info

/

Relevant log output

No response

Validations

@mynetfan
Copy link
Collaborator

mynetfan commented Dec 18, 2024

https://cn.vitejs.dev/guide/assets.html
静态资源引用务必经过import。构建之后不会保持开发时期的目录结构了

@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants