
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@icon-park/vue-next
Advanced tools
Vue3 Icons for IconPark
Please visit IconPark Website
npm install @icon-park/vue-next --save
Import an icon from @icon-park/vue-next
at the top of a component and then use it in the template tag:
<template>
<home theme="filled"/>
</template>
<script>
import {Home} from '@icon-park/vue-next';
export default {
components: {
Home
}
}
</script>
If you don't want to refer to it, you can install icons globally.
import {install} from '@icon-park/vue-next/es/all';
import {createApp} from 'vue';
const app = createApp({});
// Install
install(app); // use default prefix 'icon', eg: icon is People, name is icon-people.
install(app, 'i'); // use custom prefix 'i', eg: icon is People, name is i-people.
app.mount('#app');
Import the icon style:
import '@icon-park/vue-next/styles/index.css';
You can use IconProvider
in @icon-park/vue-next
to set the default config globally:
<template>
<div>
<home/>
</div>
</template>
<script lang="ts">
import {DEFAULT_ICON_CONFIGS, IconProvider} from '@icon-park/vue-next';
import {Home} from '@icon-park/vue-next';
export default {
name: 'App',
setup(){
IconProvider({...DEFAULT_ICON_CONFIGS, prefix: 'icon'});
},
components: {
Home
}
};
</script>
You can use babel-plugin-import to import icons on demand.
Set config like this:
{
"plugins": [
[
"import",
{
"libraryName": "@icon-park/vue-next",
"libraryDirectory": "es/icons",
"camel2DashComponentName": false
}
]
]
}
We recommend loading icons on demand, because this can greatly reduce the volume of compiled code。 However, in some scenarios similar to remote loading menus, direct reference to all icons can reduce the development cost.
Usage:
<template>
<icon-park type="AddText" theme="filled"/>
<icon-park type="add-text" theme="filled"/>
</template>
<script>
import {IconPark} from '@icon-park/vue-next/es/all';
export default {
components: {
IconPark
}
}
</script>
If you need to use additional information such as icon name, author, category, label and creation time, you can use the icons.json
file located in the root directory of each NPM.
prop | description | type | default | note |
---|---|---|---|---|
theme | Theme of the icons. | 'outline' | 'filled' | 'two-tone' | 'multi-color' | 'outline' | |
size | The width/height of the icon | number | string | '1em' | |
spin | Rotate icon with animation | boolean | false | |
fill | Colors of theme | string | string[] | 'currentColor' | |
strokeLinecap | the stroke-linecap prop of svg element | 'butt' | 'round' | 'square' | 'round' | |
strokeLinejoin | the stroke-linejoin prop of svg element | 'miter' | 'round' | 'bevel' | 'round' | |
strokeWidth | the stroke-width prop of svg element | number | 4 |
FAQs
Vue3 Icons for IconPark
The npm package @icon-park/vue-next receives a total of 1,268 weekly downloads. As such, @icon-park/vue-next popularity was classified as popular.
We found that @icon-park/vue-next demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.