我在jsx中有一个图标:
<svg xmlns="http://www.w3.org/2000/svg" width="21" height="22" viewBox="0 0 21 22">
<g
fill="none"
fillRule="evenodd"
stroke="#8D939B"
strokeLinecap="round"
strokeWidth="2"
transform="translate(-17 -11) translate(18 12)"
>
<circle stroke="#8D939B" cx="8.5" cy="8.5" r="8.5" strokeLinejoin="round" />
<path fillRule="nonzero" d="M14 19l5-5" transform="rotate(90 16 17)" />
</g>
</svg>
也有用于悬浮的css:
.menuContainer :global(.ant-menu-submenu-title:hover circle),
.menuContainer :global(.ant-menu-submenu-title:hover path) {
stroke: #03ddac !important;
}
但没有将笔划添加到悬停时circle
上的图标path
元素中。
stroke-width
是SVG的属性。尝试使用stroke-width而不是strokeWidth。另外,请确保您的浏览器支持嵌入式SVG。