svg图片比img 要小很多,几乎不占项目的资源。 1、安装依赖 pnpm install vite-plugin-svg-icons -D 2、在vite.config.ts中配置代码: 3、组件中使用: