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
主应用无法加载子应用的图片 #9
Comments
是哪一张图片加载不了呢 1、如果你是通过
这种是不行的,乾坤本身也还没支持到这个地步。 2、如果你是
需要注意 vite.config.ts 写完整的base |
好的。感谢回答! |
可添加以下下配置解决
|
这个好像不起作用 |
我试了有效。你是怎么写的? |
子应用的vite.config |
serve.origin是有效的,楼主你只需要改下你资源的引用方式就好了,图片相对路径改成@/asserts/logo.png就正常了 |
所以子应用css的图片就没救了么 |
有用的,路径要拼写完全,最后多加一个 / 就行 |
嗯嗯,这样子在开发环境能行。生产环境呢,将图片打包到主应用里或者全转为base64吗 |
加/ vite 会报提示啊,server.origin should not end with "/". Using "http://localhost:7105" instead. |
貌似不适用于用:src动态赋值图片 |
所以生产环境打包可以支持吗? |
YES |
主应用 http://localhost:9001
vue3子应用(vite) http://localhost:9300
复现仓库 https://github.com/Come2BtheOne/qiankunDemo.git
The text was updated successfully, but these errors were encountered: