nuxt-symbol-icons
nuxt-symbol-icons
A nuxt(2) module for using svg sprite icon.
Features
- Support SVGO optimization.
- Support SVG sprites powered by svg-sprite-loader
- Ability to manipulate icons. e.g. using
font-size,colorpowered by vue-symbol-icon.
Installation
# yarn
$ yarn add --dev nuxt-symbol-icons
# npm
$ npm i nuxt-symbol-icons -D
# pnpm
$ pnpm add --dev nuxt-symbol-icons
Usage
- Configure your nuxt.config.js
// nuxt.config.js
module.exports = {
// ...
buildModules: ['nuxt-symbol-icons'],
nuxtSymbolIcons: {
// ...
}
}
-
Put your SVG icon into
~/assets/icons/svg/folder. -
then, you can use
<svg-icon name="icon-name" />in projects. The<svg-icon />component powered by vue-symbol-icon
Options
| Key | Type | Default value | Description |
|---|---|---|---|
enable |
boolean |
true |
Whether to enable nuxt-symbol-icons |
svgoConfig Added in v2.0.0 |
boolean/SvgoConfig |
{} |
Define configuration of SVGO, if set to false, will disable SVGO. |
enableSvgoPresetDefaultConfig Added in v2.0.0 |
boolean |
true |
Whether to add preset-default config for SVGO |
svgSymbolIdPrefix |
string |
icon- |
Define the SVG symbol id prefix. |
globalComponentName |
string |
SvgIcon |
Define the global component name of vue-symbol-icon. |
svgSpriteLoaderIncludeDir |
string |
assets/icons/svg |
Define the include folder for svg-sprite-loader. |
requireContextSvgDir |
string |
~/assets/icons/svg |
Define the SVG icons folder for Batch imports via require.context. |
extraSvgSpriteLoaderOptions |
Record<string, any> |
{} |
Configure extra options for svg-sprite-loader. |
extraPreLoaders |
RuleSetUseItem[] |
[] |
Use some other loaders before svg-sprite-loader processes SVG. |
CHANGE LOG
see CHANGE LOG
Related Packages
nuxt-svg-icon-module
Nuxt module for lazy-loading inline SVG icons from your assets directory
1,456
5
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 2.1.2 | ^2.0 | MIT | |
| 2.1.1 | ^2.0 | MIT | |
| 2.1.0 | ^2.0 | MIT | |
| 2.0.3 | ^2.0 | MIT | |
| 2.0.2 | ^2.0 | MIT | |
| 2.0.1 | ^2.0 | MIT | |
| 2.0.0 | ^2.0 | MIT | |
| 1.8.0 | ^2.0 | MIT | |
| 1.7.2 | ^2.0 | MIT | |
| 1.7.1 | ^2.0 | MIT | |
| 1.7.0 | ^2.0 | MIT | |
| 1.6.4 | ^2.0 | MIT | |
| 1.6.3 | ^2.0 | MIT | |
| 1.6.2 | ^2.0 | MIT | |
| 1.6.1 | ^2.0 | MIT | |
| 1.6.0 | ^2.0 | MIT | |
| 1.5.1 | ^2.0 | MIT | |
| 1.5.0 | ^2.0 | MIT | |
| 1.4.6 | ^2.0 | MIT | |
| 1.4.5 | ^2.0 | MIT | |
| 1.4.4 | ^2.0 | MIT | |
| 1.4.3 | ^2.0 | MIT | |
| 1.4.2 | ^2.0 | MIT | |
| 1.4.1 | ^2.0 | MIT | |
| 1.4.0 | ^2.0 | MIT | |
| 1.3.0 | ^2.0 | MIT | |
| 1.2.0 | ^2.0 | MIT |