只需要将图片放到 public目录下 然后以此路径为起点设置路径就可以了
使用component style
const Container = styled.div`
background: url("wave.svg");
`;
直接使用Public资料夹中的图片档案(SVG可以)
来源:https://blog.csdn.net/printf_hello/article/details/118887651
其他方法:
https://medium.com/itsoktomakemistakes/react-create-react-app-svg-icons-styled-component-570b4e9f07b
<Image>
放在最上面import Image from "next/image";
''
2. 将要放入的图片写成引入的自定义名称
import Iconinfo from "../public/Icon/Icon-info.svg";
<Image>
标签,src需用{}包起来自定义名称,alt标签一定要写,完成如下<Image src={Iconinfo} alt="Picture of the author" />
<<: # Day5--Funny Function!一招函式打天下?
如果不想要大家一起通灵通出一坨O,请不要偷懒做好规划。我说那个Excel写出来的功能列表也是不够的,...
使用 State Hook 的步骤 其实在前面文章写过几次 Hook ,其实动作也就三个。 宣告一个...
文件:专案工作手册(维基)、专案文件 开会 电话、座位即时确认 ...
PIXI.ParticleContainer 今天介绍用PIXI.ParticleContainer...
天亮了 昨晚是平安夜 关於迷雾森林故事 粉红烟花三个月 由於黑洞把12只 animal 吸走後的烟 ...