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 异常 #49

Open
jinjinwa opened this issue Feb 7, 2018 · 1 comment
Open

svg 异常 #49

jinjinwa opened this issue Feb 7, 2018 · 1 comment

Comments

@jinjinwa
Copy link

jinjinwa commented Feb 7, 2018

刷新后:
image
刷新前:
image

下载下来官网例子后无法运行,吧 /icon 页面, 按照官网文档,改成

const CustomIcon = ({ type, className = '', size = 'md', ...restProps }) => (
  <svg
    className={`am-icon am-icon-${type.substr(1)} am-icon-${size} ${className}`}
    {...restProps}>
    <use xlinkHref={type} /> {/* svg-sprite-loader@0.3.x */}
    {/* <use xlinkHref={#${type.default.id}} /> */} {/* svg-sprite-loader@latest */}
  </svg>
);

 <CustomIcon type={require('../static/reload.svg')} />

来使用 svg, 是可以正常显示 svg 的,但是刷新浏览器,会抛出异常,如上图所示

  • antd-mobile 版本:2.0.0-beta.2 ~ 2.1.6
  • 浏览器: chrome63.0
  • 操作系统及其版本:mac os
@warmhug
Copy link
Contributor

warmhug commented Feb 9, 2018

svg-sprite-loader@0.3.x 这个对吗

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

No branches or pull requests

2 participants