
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
vite-plugin-iconify-preset
Advanced tools
该包是为了弥补<i-ant-design-caret-down-filled />这种按需引入的不足,这种写法很好用,但在项目中往往需要<Icon class="icon" :name="name" :width="width" :height="height" />这种写法,并把将要用到的图标预先设置好将其打包。例如图标显示哪一个,需要从接口中获取。模版中按需引入的(<i-ant-design-caret-down-filled />)写法此时无法满足需求,于是写了此包。
npm i vite-plugin-iconify-preset
// vite.config.ts
import Icon from 'vite-plugin-iconify-preset'
plugins: [
...,
Icon([
'ant-design:linkedin-outlined',
'ant-design:ant-design-outlined',
...
])
]
// vue3
import { Icon } from 'vite-plugin-iconify-preset/vue'
// vue2
import { Icon } from 'vite-plugin-iconify-preset/vue2'
components: {
Icon
}
<Icon
class="icon"
:name="name"
:width="width"
:height="height"
/>
// react
import { Icon } from 'vite-plugin-iconify-preset/react'
<Icon
className="icon"
name={name}
width={width}
height={height}
/>
找不到模块“vite-plugin-iconify-preset/vue”或其相应的类型声明
如果出现这样的编辑器报错,可在tsconfig文件下include配置".d.ts",在".d.ts"文件内声明:declare module 'vite-plugin-iconify-preset/vue'
(react 亦此)
邮箱: 237613578@qq.com 如发现问题或是有疑惑请联系作者
FAQs
Preset the icon to be packaged
The npm package vite-plugin-iconify-preset receives a total of 15 weekly downloads. As such, vite-plugin-iconify-preset popularity was classified as not popular.
We found that vite-plugin-iconify-preset demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.