关于使用 @iconify/iconify图标库组件在vite中的使用

这篇文章介绍了如何使用Iconify,一个通用的图标框架,它集成了多个图标库如AntDesign和ElementUI。文章详细讲解了通过npm安装、配置Vite插件PurgeIcons,并给出了一个使用示例,展示了如何在项目中轻松引入和展示图标。
摘要由CSDN通过智能技术生成

Iconify 是最通用的图标框架,将各种图标库的图标集中在这里的一个组件库,例如ant-design,element-ui等 网站地址如下
https://iconify.design/getting-started/
使用过程如下

npm install @iconify/iconify -S
npm install vite-plugin-purge-icons @iconify/json -D

配置如下
在这里插入图片描述
在入口文件或者使用页面导入下面

// main.js
import '@purge-icons/generated'

在这里插入图片描述
使用案例

 <div :size="16" class="op-btn" @click="copyCode">
            <a-tooltip>
              <template #title>复制代码</template>
              <div><span class="iconify" data-icon="ph:copy" Color="#3451b2" style="font-size:20px"> </span> </div> 
            </a-tooltip>
          </div>

更详细的使用
https://blog.csdn.net/m0_61989957/article/details/129479568

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency [###...............] / idealTree:yargs: timing idealTree:node_modules/.pnpm/@babel+preset-modules@0.1.5_@babel+core@7[###...............] / idealTree:@commitlint/config-conventional: timing idealTree:node_modules/.pnpm/@commitlint+con[###...............] | idealTree:@commitlint/read: timing idealTree:node_modules/.pnpm/@commitlint+read@17.5.1/node_m[###...............] | idealTree:@commitlint/read: timing idealTree:node_modules/.pnpm/@commitlint+read@17.5.1/node_m[###...............] - idealTree:@commitlint/read: timing idealTree:node_modules/.pnpm/@commitlint+read@17.5.1/node_m[###...............] | idealTree:@commitlint/read: timing idealTree:node_modules/.pnpm/@commitlint+read@17.5.1/node_m[##................] \ idealTree:loader-utils: sill placeDep node_modules/.pnpm/@cspotcode+source-map-support@0.8.1 j[##................] - idealTree:karma-coverage: sill placeDep node_modules/.pnpm/@eslint+eslintrc@2.0.3/node_modules[##................] | idealTree:sinon: sill placeDep node_modules/.pnpm/@eslint+eslintrc@2.0.3 supports-color@7.2.0 [##................] / idealTree:espree: timing idealTree:node_modules/.pnpm/@gar+promisify@1.1.3/node_modules/@gar/p[##................] - idealTree:espree: timing idealTree:node_modules/.pnpm/@gar+promisify@1.1.3/node_modules/@gar/p[##................] \ idealTree:xo: sill placeDep node_modules/.pnpm/@gar+promisify@1.1.3/node_modules/@gar/promisif[##................] \ idealTree:xo: sill placeDep node_modules/.pnpm/@gar+promisify@1.1.3/node_modules/@gar/promisif[##................] / idealTree:xo: sill placeDep node_modules/.pnpm/@gar+promisify@1.1.3/node_modules/@gar/promisif[##................] / idealTree:xo: sill placeDep node_modules/.pnpm/@gar+promisify@1.1.3/node_modules/@gar/promisif[##................] | idealTree:xo: sill placeDep node_modules/.pnpm/@gar+promisify@1.1.3/node_modules/@gar/promisif[##................] \ idealTree:c8: timing idealTree:node_modules/.pnpm/@humanwhocodes+module-importer@1.0.1/node_mo[##................] / idealTree:@iconify-json/carbon: timing idealTree:node_modules/.pnpm/@iconify-json+carbon@1.1.1[##................] / idealTree:@iconify-json/carbon: timing idealTree:node_modules/.pnpm/@iconify-json+carbon@1.1.1
07-04
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值