Logo

GitLab

Sign in

xlyErp / xlyUmi

  • Back to Dashboard
  • Project
  • Activity
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • Snippets
  • xlyUmi
  • src
  • components
  • SvgIcon
  • index.js
  • 使用umi icons加载svg;
    361d7815
    zhang authored
    2025-05-16 11:00:40 +0800  
    Browse Code »
index.js 441 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
import { Icon } from "umi";
const SvgIcon = props => {
  const { iconClass = "add", className, size, offsetX, fill, offsetY } = props;
  return (
    <Icon
      className={className}
      width={size}
      height={size}
      style={{
        position: "relative",
        top: `${offsetY}px`,
        left: `${offsetX}px`,
        fill,
      }}
      {...props}
      icon={`local:${iconClass}`}
    />
  );
};

export default SvgIcon;