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

2次阅读

共计 408 个字符,预计需要花费 2 分钟才能阅读完成。

<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 代理

正文完
 0