关于前端:引用本地svg-不显示-报跨域错误

<use xlink:href="img/myicons.svg#arrow" transform="scale(0.05)"/>

问题剖析:
如果应用Chrome,它的平安模型将阻止本地文件援用不同目录中的其余文件。Firefox的平安模型容许本地文件援用其余本地文件,前提是援用的文件位于同一目录或援用者的子目录中。
If you’re using Chrome it’s security model prevents local files referring to other files in different directories. Firefox’s security model allows local files to refer to other local files provided that the referenced file is in the same directory or a subdirectory of the referrer.

解决问题:
应用nginx代理

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理