1.0.14 • Published 6 months ago

@eyes22798/svg-icon v1.0.14

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

svg-icon

A lightweight component with no dependecy to allow use of custom SVG icons in your Vue.js application based on SVG sprite.

Installation

Using NPM:

npm install @eyes22798/svg-icon --save

Using Yarn:

yarn add @eyes22798/svg-icon

Requirements

  • Vue.js (2.x+)
  • svgxuse polyfill to support IE9-11 version
  • SVG sprite file that should be available in "/assets/icons" folder (can be changed, changed in vue.config.js)

Usage

In your main.js file:

import SvgIcon from '@eyes22798/svg-icon'

Vue.use(SvgIcon)

In your vue.config.js

You can customize the component name and icon assets dir

const SvgIconConfig = require('@eyes22798/svg-icon/webpack')

module.exports = {
  chainWebpack: (config) => {
    SvgIconConfig({ config, iconPath: './src/assets/icons', name: 'svg-icon' })
  }
}

In your components:

this name is current svg file name

  <svg-icon name="file_name" className="iconClass"></svg-icon>
  • name - SVG sprite symbol id value (svg file name)
  • className - svg class,arrays are supported(:className=['class1', 'class2']

Customize configuration

See Configuration Reference.

1.0.2

7 months ago

1.0.1

8 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.11

6 months ago

1.0.14

6 months ago

1.0.13

6 months ago

1.0.12

6 months ago

1.0.0

11 months ago

0.1.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago