Vuejs-Vue icon font: vue-icon-font - A iconfont plugin for Vuejs (support Font-class and Symbol).

vue-icon-font

Build Status Vue 2.x

A iconfont plugin for Vuejs 中文说明

Screenshots

screenshot screenshot screenshot

Installation

NPM (Recommended)

# install dependencies
npm install vue-icon-font

manual

# Download `dist/vue-iconfont.js` and include it in your HTML file
<script src="../dist/vue-iconfont.js"></script>

Iconfont assets

It’s a Vector Icon Management & Communication Platform made by Alimama MUX, designers could upload vector icons here, and users could download it by several kinds of format.Also, the icons could be translated into Fonts for front-end engineers’ usage. screenshot

Download the icons from iconfont.cn, and upzip download.zip.

font-class

copy iconfont.css and font files (.ttf,.eot,.svg,.woff) into your project

# Include the iconfont.css stylsheet into your <head>
<link rel="stylesheet" href="./iconfont.css">

or

# Import css
import './iconfont.css';

use: <icon name="account" type="class"></icon>

symbol,svg (Default,Recommended)

copy iconfont.js into your project

# Include the iconfont.css stylsheet into your <head>
<link rel="stylesheet" href="./iconfont.css">

or

import './iconfont.js';

use: <icon name="password"></icon>

Usage via import (vue-cli)

import Vue from 'vue'
import VueIconFont from 'vue-icon-font'
Vue.use(VueIconFont)

/* font-class */
import '@/assets/iconfont/iconfont.css'

/* symbol,svg */
import '@/assets/iconfont/iconfont.js'
<!-- font-class -->
<icon name="account" type="class"></icon>

<!-- symbol,svg -->
<icon name="password"></icon>

Simple demo here

Comments

  • Setup Airbrake for your JavaScript application
    Setup Airbrake for your JavaScript application

    Sep 18, 2017

    Install Airbrake in 2 easy steps:

    Step 1: Add the library Include via CDN:

    <script src="https://cdnjs.cloudflare.com/ajax/libs/airbrake-js/0.9.7/client.min.js"></script>
    

    We also support installation via npm and Bower.

    Step 2: Copy this config snippet to your app.js file

    (You can find your project ID and API KEY with your project's settings):

    var airbrake = new airbrakeJs.Client({
      projectId: <Your project ID>,
      projectKey: '<Your project API Key>'
    });
    airbrake.addFilter(function (notice) {
      notice.context.environment = 'production';
      return notice;
    });
    

    Visit official GitHub repo for more info on alternative configurations and advanced options.

    airbrake 
    Reply
  • 让图标宽高可配置
    让图标宽高可配置

    Mar 1, 2018

    可以添加一个 width, height 的属性吗? 因为 icon 的宽高不一定是 1:1 的情况?

    Reply
  • 无法响应事件
    无法响应事件

    Apr 21, 2020

    click事件等绑定无法响应

    建议:添加 v-on="$listeners" v-bind="$attrs"

    Reply
  • Update README-cn.md
    Update README-cn.md

    Mar 4, 2019

                                                                                                                                                                                                           
    Reply
  • import it via vue-cli
    import it via vue-cli

    Oct 2, 2017

    Hi, i met some problem to import vue-icon-font into my project,

    i have download it. and use import VueIconFont from 'vue-icon-font' , but when i add these two imports:

    import '@/assets/iconfont/iconfont.css' import '@/assets/iconfont/iconfont.js'

    it will show me : These relative modules were not found:

    • ./iconfont.ttf?t=1505287310793 in ./~/css-loader?{"minimize":false,"sourceMap":false}!./src/assets/iconfont/iconfont.css
    • ./iconfont.eot?t=1505287310793 in ./~/css-loader?{"minimize":false,"sourceMap":false}!./src/assets/iconfont/iconfont.css
    • ./iconfont.svg?t=1505287310793 in ./~/css-loader?{"minimize":false,"sourceMap":false}!./src/assets/iconfont/iconfont.css
    Reply