Vue-Octicon
Octicon component for Vue.js, using inline SVG.
Vue-Octicon is built upon Octicons v5.0.1
and depends on Vue.js v2.0.1
+.
Installation
NPM (Recommended)
$ npm install vue-octicon
bower
$ bower install vue-octicon
manual
Just download dist/vue-octicon.js
and include it in your HTML file:
Usage
<!-- basic --> <!-- with options -->
ES Modules with NPM & vue-loader (Recommended)
// Pick one way betweem the 2 following ways // only import the icons you use to reduce bundle size // or import all icons if you don't care about bundle size
Heads up
if you are using vue-cli
to create your project, the webpack
template may exclude node_modules
from files to be transpiled by Babel. Change the exclude
value from /node_modules/
to /node_modules(?![\\/]vue-octicon[\\/])/
to fix the problem.**
CommonJS with NPM without ES Next support
var Vue = // requiring the UMD modulevar Octicon = // or with vue-loader you can require the src directlyvar Octicon = // register component to use
AMD
require
Global variable
The component class is exposed as window.VueOcticon
.
Local development
$ npm i$ npm run dev
Open http://localhost:8080/demo
to see the demo.
Updating icons
Don't touch files in src/icons
but update assets/icons.json
instead and run npm run icons
to re-generate icon module files.
Registering custom icons
You can register custom icons like this:
// ES Modules with vue-loader Octicon
Related projects
- Vue-Awesome by the same author of Vue-Octicon.