ant-design/antd-mobile-samples

svg 异常

jinjinwa opened this issue · 1 comments

刷新后:
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