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-icon 是否可以通过url地址加载svg图标呢? #2034

Closed
Erik5169 opened this issue May 9, 2019 · 7 comments
Closed

svg-icon 是否可以通过url地址加载svg图标呢? #2034

Erik5169 opened this issue May 9, 2019 · 7 comments

Comments

@Erik5169
Copy link

Erik5169 commented May 9, 2019

类似于img标签通过url连接从网络上加载图片一样

@PanJiaChen
Copy link
Owner

svg 本身是支持的。 https://stackoverflow.com/questions/34097191/using-a-svg-file-in-html-from-a-url

不过你这样做的意义是什么?

@Erik5169
Copy link
Author

Erik5169 commented May 9, 2019

服务端返回的是一个icon的地址,我在想如果用svg图标的地址是否一样可以用svg-icon组件

@PanJiaChen
Copy link
Owner

我来实现一下吧。

@PanJiaChen
Copy link
Owner

我测了下,使用 url 加载的方式有一个弊端,不能修改 svg 的颜色。

@Erik5169
Copy link
Author

把svg源文件中的fill 跟stroke填充颜色去掉的话,应该能修改吧,不能修改颜色也没关系,可以加载就行了

@PanJiaChen
Copy link
Owner

Added in #2052

@Erik5169
Copy link
Author

多谢裤衩哥

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

No branches or pull requests

2 participants