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

svg中图片路径问题 #1222

Open
hehanli101 opened this issue May 16, 2024 · 3 comments
Open

svg中图片路径问题 #1222

hehanli101 opened this issue May 16, 2024 · 3 comments
Labels
feature Planned functions TODO

Comments

@hehanli101
Copy link

测试过程中发现如果svg里面的图片路径是相对的话,会自动补全基座的域名,不像模板里面那样直接补全子应用的url

image

页面的效果就是svg里面的图片展示不出来
image

除了把svg里面的路径写死,有什么其他的办法处理吗?

@bailicangdu bailicangdu added feature Planned functions TODO labels May 16, 2024
@bailicangdu
Copy link
Member

@hehanli101
Copy link
Author

webpack项目可以设置publicPath https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/framework/vue?id=_3%e3%80%81%e8%ae%be%e7%bd%ae-publicpath

我使用的是官网的例子,我看到/dev/children/vue2 vue.config.js配置了publicPath

我也main.js里面引入了public-path.js 也是不行的

@marsshen77
Copy link

同样的问题,不同的是我这边在Chrome浏览器中能正常补全地址,在firefox中子应用的svg文件就变成了相对路径。环境为vite+react

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Planned functions TODO
Projects
None yet
Development

No branches or pull requests

3 participants