我在 React 网页中导入了一个SVG 文件。问题是显示的SVG 有一些颜色错误。
正如您在网页上看到的,有 3 个 SVG。其中 2 个显示颜色错误。但第一个有原始颜色。尽管 3 SVG 的导入和使用方式完全相同。
在 MyPage.jsx 中,我导入它们
import Hanshake from '../images/handshake.svg';
import Logistics from '../images/logistics.svg';
import Designer from '../images/designer.svg';
Run Code Online (Sandbox Code Playgroud)
然后像这样简单地使用它:
<Col xs={24} md={8} className='about_illustration_text'>
<Hanshake />
Some text
</Col>
<Col xs={24} md={8} className='about_illustration_text'>
<Logistics />
Some text
</Col>
<Col xs={24} md={8} className='about_illustration_text'>
<Designer />
Some text
</Col>
Run Code Online (Sandbox Code Playgroud)
我没有发现任何 CSS 冲突。
那些 SVG 有什么问题?