Giter Club home page Giter Club logo

vue-awesome's Introduction

Vue-Awesome

Awesome SVG icon component for Vue.js, with built-in Font Awesome icons.

🇨🇳 中文版

Vue-Awesome an SVG icon component for Vue.js, with built-in icons courtesy of Font Awesome.

Check out the demo here.

Installation

npm (Recommended)

$ npm install vue-awesome

bower

$ bower install vue-awesome

Manual

Just download dist/vue-awesome.js and include it in your HTML file:

<script src="path/to/vue-awesome/dist/vue-awesome.js"></script>

Usage

<!-- basic -->
<v-icon name="beer"/>

<!-- with options -->
<v-icon name="sync" scale="2" spin/>
<v-icon name="comment" flip="horizontal"/>
<v-icon name="code-branch" label="Forked Repository"/>

<!-- stacked icons -->
<v-icon label="No Photos">
  <v-icon name="camera"/>
  <v-icon name="ban" scale="2" class="alert"/>
</v-icon>

Font Awesome 5 has separated all icons into several packs. Vue-Awesome is built upon its all free icons, which includes all free icons from 3 icon packs: regular, solid and brands. Since the solid pack has the most number of icons, we organize all Vue-Awesome icons as follows:

  • All icons from solid pack are located in vue-awesome/icons directory and have unprefixed name prop values.

  • Icons from regular and brands are located in vue-awesome/icons/regular and vue-awesome/icons/brands, which have prefixed name prop values like regular/flag or brands/reddit.

You can find all available name values from Font Awesome's website like beer, file and camera.

ES Modules with NPM & vue-loader (Recommended)

import Vue from 'vue'

/* Pick one way between the 2 following ways */

// only import the icons you use to reduce bundle size
import 'vue-awesome/icons/flag'

// or import all icons if you don't care about bundle size
import 'vue-awesome/icons'

/* Register component with one of 2 methods */

import Icon from 'vue-awesome/components/Icon'

// globally (in your main .js file)
Vue.component('v-icon', Icon)

// or locally (in your component file)
export default {
  components: {
    'v-icon': Icon
  }
}

⚠️ Heads up

Importing the souce version

If you are using official Vue CLI to create your project and you want to use the untranspiled component (import vue-awesome/components/Icon rather than import vue-awesome directly, to optimize bundle size, which is recommended), you'll encounter the problem that the default configuration will exclude node_modules from files to be transpiled by Babel.

For Vue CLI 3+, add vue-awesome into transpileDependencies in vue.config.js like this:

// vue.config.js
module.exports = {
  transpileDependencies: [
    /\bvue-awesome\b/
  ]
}

For Vue CLI 2 with the webpack template, modify build/webpack.base.conf.js like this:

      {
        test: /\.js$/,
        loader: 'babel-loader',
-       include: [resolve('src'), resolve('test')]
+       include: [
+         resolve('src'),
+         resolve('test'),
+         resolve('node_modules/vue-awesome')
+       ]
      }

If you are using bare webpack config, just do similar modifications make it work.

Using with Nuxt.js

When using Vue-Awesome on the server side with Nuxt.js, it may prompt Unexpected token import because Nuxt.js has configured an external option by default, which prevent files under node_modules from being bundled into the server bundle with only a few exceptions. We need to whitelist vue-awesome in nuxt.config.js as follows:

For Nuxt.js 2:

module.exports = {
  // ...
  build: {
    transpile: [/^vue-awesome/]
  }
}

For Nuxt.js 1:

// Don't forget to
// npm i --save-dev webpack-node-externals
const nodeExternals = require('webpack-node-externals')

module.exports = {
  // ...
  build: {
    extend (config, { isServer }) {
      // ...
      if (isServer) {
        config.externals = [
          nodeExternals({
            // default value for `whitelist` is
            // [/es6-promise|\.(?!(?:js|json)$).{1,5}$/i]
            whitelist: [/es6-promise|\.(?!(?:js|json)$).{1,5}$/i, /^vue-awesome/]
          })
        ]
      }
    }
  }
}
Unit Testing with Jest

Make sure to whitelist vue-awesome from the transformIgnorePattern. Add following configuation in test/unit/jest.conf.js:

+ transformIgnorePatterns: [
+   '/node_modules(?![\\\\/]vue-awesome[\\\\/])/'
+ ],

Don't import all icons if you don't want to make unit testing slow because this will transform all icons from ES module and thus slow down the test process.

CommonJS with NPM without ES Next support

var Vue = require('vue')

// requiring the UMD module
var Icon = require('vue-awesome')

// or with vue-loader you can require the src directly
var Icon = require('vue-awesome/components/Icon')

// register component to use

AMD

require.config({
  paths: {
    'vue-awesome': 'path/to/vue-awesome'
  }
})

require(['vue-awesome'], function (Icon) {
  // register component to use
  Vue.component('v-icon', Icon)
})

Global variable

The component class is exposed as window.VueAwesome.

// register component to use
Vue.component('v-icon', VueAwesome)

Props

  • name: string

    The name of the icon. It's necessary if the component isn't used as the wrapper of an icon stack. All valid names correspond to the file path relative to the icons directory. Notice that you may have to check the name of the icon pack after you search on FontAwesome's website. For example, you'll see a URL argument of style=brands on the detail page for 500px and the icon name will be brands/500px.

    Only free icons for FontAwesome are available by default and because the solid style has the most icons, we've made it the default pack so the path prefixes can be omitted.

    If you pass null to this prop, the whole component will not be rendered.

  • scale: number|string

    Used to adjust the size of the icon. Default to 1.

  • spin: boolean

    Used to specify whether the icon is spining. Default to false. (Can't use together with pulse.)

  • pulse: boolean

    Set the pulse effect to the icon. Default to false. (Can't use together with spin.)

  • inverse: boolean

    If set to true, the color of the icon will become #fff. Default to false.

  • flip: 'vertical'|'horizontal'|'both'

    Used to flip the icon.

  • label: string

    Set the aria-label for the icon if provided.

  • title: string

    Set the title for the icon.

The icon will have role="presentation" thus not accessible when neither label nor title exists.

Misc

If you are using vue-awesome/components/Icon (instead of the whole bundled version), Vue-Awesome won't import a single icon by default. Do not forget to import icons you want to use.

If these caveats don't help and there are no proper workarounds in earlier issues, please feel free to file a new one.

Styling

Dynamic sizing

You can make the icons scale dynamically according to your font-size by adding the following CSS:

.fa-icon {
  width: auto;
  height: 1em; /* or any other relative font sizes */

  /* You would have to include the following two lines to make this work in Safari */
  max-width: 100%;
  max-height: 100%;
}

Colors

The icon color is inherited from the font color of the parent element by default. You can easily change it to any other color by specifying the color property.

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/svg/* instead and run npm run icons to re-generate icon module files.

Registering custom icons

Simple case

You can register custom icons like this:

import Icon from 'vue-awesome/components/Icon'

Icon.register({
  baidu: {
    width: 23.868,
    height: 26,
    d: 'M3.613 13.701c2.827-.608 2.442-3.986 2.357-4.725-.138-1.139-1.477-3.128-3.296-2.971C.386 6.21.052 9.515.052 9.515c-.309 1.528.74 4.793 3.561 4.186zm3.002 5.875c-.083.238-.268.846-.107 1.375.315 1.187 1.346 1.24 1.346 1.24h1.48v-3.619H7.749c-.713.213-1.057.767-1.134 1.004zM8.86 8.035c1.562 0 2.823-1.797 2.823-4.019C11.683 1.796 10.421 0 8.86 0 7.301 0 6.036 1.796 6.036 4.016c0 2.222 1.265 4.019 2.824 4.019zm6.724.265c2.087.271 3.429-1.956 3.695-3.644.272-1.686-1.074-3.644-2.552-3.98-1.48-.339-3.329 2.032-3.497 3.578-.2 1.89.271 3.778 2.354 4.046zm5.114 9.923s-3.229-2.498-5.113-5.198c-2.555-3.981-6.185-2.361-7.399-.337-1.209 2.024-3.093 3.305-3.36 3.644-.271.334-3.9 2.293-3.095 5.871.806 3.576 3.635 3.508 3.635 3.508s2.085.205 4.504-.336c2.42-.537 4.503.134 4.503.134s5.652 1.893 7.199-1.751c1.545-3.645-.874-5.535-.874-5.535zm-9.671 5.423H7.352c-1.587-.316-2.219-1.4-2.299-1.584-.078-.188-.528-1.059-.29-2.539.686-2.219 2.642-2.379 2.642-2.379h1.956V14.74l1.666.025v8.881zm6.844-.025h-4.229c-1.639-.423-1.716-1.587-1.716-1.587v-4.677l1.716-.027v4.203c.104.447.661.529.661.529h1.742v-4.705h1.825v6.264zm5.986-12.486c0-.808-.671-3.239-3.159-3.239-2.492 0-2.825 2.295-2.825 3.917 0 1.548.131 3.71 3.227 3.641 3.096-.068 2.757-3.507 2.757-4.319z'
  }
})

More advanced cases

If your SVG file has more than one path or polygon, and/or you want to have a predefined style, you can register like this:

Paths

import Icon from 'vue-awesome/components/Icon'

Icon.register({
  webpack: {
    width: 1200,
    height: 1200,
    paths: [
      {
        style: 'fill:#8ED6FB',
        d: 'M1035.6 879.3l-418.1 236.5V931.6L878 788.3l157.6 91zm28.6-25.9V358.8l-153 88.3V765l153 88.4zm-901.5 25.9l418.1 236.5V931.6L320.3 788.3l-157.6 91zm-28.6-25.9V358.8l153 88.3V765l-153 88.4zM152 326.8L580.8 84.2v178.1L306.1 413.4l-2.1 1.2-152-87.8zm894.3 0L617.5 84.2v178.1l274.7 151.1 2.1 1.2 152-87.8z'
      },
      {
        style: 'fill:#1C78C0',
        d: 'M580.8 889.7l-257-141.3v-280l257 148.4v272.9zm36.7 0l257-141.3v-280l-257 148.4v272.9zm-18.3-283.6zM341.2 436l258-141.9 258 141.9-258 149-258-149z'
      }
    ]
  }
})

Polygons

import Icon from 'vue-awesome/components/Icon'

Icon.register({
  vue: {
    width: 256,
    height: 221,
    polygons: [
      {
        style: 'fill:#41B883',
        points: '0,0 128,220.8 256,0 204.8,0 128,132.48 50.56,0 0,0'
      },
      {
        style: 'fill:#35495E',
        points: '50.56,0 128,133.12 204.8,0 157.44,0 128,51.2 97.92,0 50.56,0'
      }
    ]
  }
})

Raw SVG

If you are using Vue.js version prior to 2.6.0, you need to include innersvg-polyfill before you use this feature.

import Icon from 'vue-awesome/components/Icon'

Icon.register({
  'html5-c': {
    width: 512,
    height: 512,
    raw: '<path fill="#E34F26" d="M71,460 L30,0 481,0 440,460 255,512"/><path fill="#EF652A" d="M256,472 L405,431 440,37 256,37"/><path fill="#EBEBEB" d="M256,208 L181,208 176,150 256,150 256,94 255,94 114,94 115,109 129,265 256,265zM256,355 L255,355 192,338 188,293 158,293 132,293 139,382 255,414 256,414z"/><path fill="#FFF" d="M255,208 L255,265 325,265 318,338 255,355 255,414 371,382 372,372 385,223 387,208 371,208zM255,94 L255,129 255,150 255,150 392,150 392,150 392,150 393,138 396,109 397,94z"/>'
  }
})

vue-awesome's People

Contributors

bsqql123 avatar dependabot[bot] avatar fizzbuzzer avatar israelss avatar johnlindquist avatar justineo avatar leuisken avatar navcat avatar scyclops avatar tmorehouse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-awesome's Issues

Assistance/Instructions for vue-cli webpack

I just cannot get this to work.

The closest I get is

SyntaxError: import declarations may only appear at top level of a module
    import './500px'

Readme states

Change the exclude value from /node_modules/ to /node_modules(?!/vue-awesome/ to fix the problem.**

which seems to be a bad regular expression and should be /node_modules(?!\/vue-awesome\/)/ ???

My main.js currently starts

import Vue from 'vue'
import Icon from 'vue-awesome/components/Icon.vue'

import 'vue-awesome/icons'

Vue.component('icon', Icon)

but I have tried multiple combinations, both in main.js and App.vue all without success.

Just as an observation, if I import a single icon with

import 'vue-awesome/icons/sign-out'

I get

SyntaxError: import declarations may only appear at top level of a module
    import Icon from '../components/Icon.vue'

npm run build returns

ERROR in static/js/vendor.1724b56a402d6484b6c1.js from UglifyJs
SyntaxError: Unexpected token: name (Icon) [./~/vue-awesome/icons/sign-out.js:1,0]

Unexpected token <

app.js

import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue';
import Icon from 'vue-awesome/components/Icon.vue'

import  { event } from './utils'
import store from './store'

Vue.use(BootstrapVue);
Vue.component('icon', Icon);

const app = new Vue({
  el: '#app',
  store,
  render: h => h(require('./main.vue')),
  created () {
    event.init()
  }
})

export { app, store }

"brunch": "2.7.4"
"vue": "2.1.8"

screenshot from 2017-01-04 07-18-38

Has anyone encountered this problem?

npm package seems broken?

Hi,

My pipeline/CI build is failing since your last npm version. When building my nuxt application, Webpack resolver do not finds any font awesome icons with import "vue-awesome/icons/fa-some-icon" way. Version 2.2.3 works as expected.

Can add more details later if you want

Workaround for now: Set vue-awesome to 2.2.3 in package.json file.

Raw svg doesn't seem to work in internet explorer

Vue Version: 2.3.0
Vue-awesome Version: 2.3.0

It seems like if you register a raw svg it doesn't work in Internet Explorer 11 and below, not sure about Edge.

Icon.register({
sweden: {
      width: 300,
      height: 150,
      raw: '<rect width="300" height="150" fill="#006aa7"></rect><rect width="30" height="150" x="100" fill="#fecc00"></rect><rect width="300" height="30" y="60" fill="#fecc00"></rect>'
    }
})

In <IE11 the paths will be empty, while in Chrome and Firefox it works fine.
IE:

<svg xmlns="http://www.w3.org/2000/svg" class="flag-icon fa-icon" role="presentation" viewBox="0 0 300 150" width="16" height="8" data-v-4d200f48="" version="1.1">
    <g />
</svg>

Chrome:

<svg data-v-4d200f48="" version="1.1" role="presentation" width="16" height="8" viewBox="0 0 300 150" class="flag-icon fa-icon">
    <g>
        <rect width="300" height="150" fill="#006aa7"></rect><rect width="30" height="150" x="100" fill="#fecc00"></rect><rect width="300" height="30" y="60" fill="#fecc00"></rect>
    </g>
</svg>

If I with the DOM explorer parse the paths right into the element it displays correctly.

Can not get around vue-awesome

Hi,

First, I want to note that I am new to Vue, but I am trying to add font awesome to my project, and last 4 hours I can't get around it!!!

So, I cloned this code to start my project: https://github.com/hal0gen/vue-foundation

Then I followed your instructions as following:

  1. I've installed vue-awesome via npm

  2. My main JS look like this:

import Icon from 'vue-awesome/components/Icon';
import jQuery from 'jquery';
import Vue from 'vue';

and below:

Vue.component('icon', Icon);

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App, Icon },
});
  1. my webpack.base.conf.js looks like:

        test: /\.js$/,
        loader: 'babel-loader',
        include: [resolve('src'), resolve('test')],
        include: [resolve('src'), resolve('test'), resolve('node_modules/vue-awesome')]
      },

Now, if I go to my home.vue and add an Icon, I don't see the Icon in my browser.. what Am I missing ?>
Can someone please help me with this :(

Invalid prop: custom validator check failed for prop "name"

Added vue-awesome like this:

// main.js
import Vue from 'vue'
import App from './App'

const Icon = require('../node_modules/vue-awesome/src/components/Icon.vue')

Vue.component('icon', Icon)

/* eslint-disable no-new */
new Vue({
  el: 'body',
  components: {
    App,
    Icon
  }
})
<template>
  <div class="item">
    <icon name="repo"></icon>
    <span>item1</span>
  </div>
</template>

But getting the following errors in the console (I've tried import, require from both dist and src files but all the same errors):

[Vue warn]: Invalid prop: custom validator check failed for prop "name". (found in component: <icon>)
[Vue warn]: Error when evaluating expression "function width() {
      return this.icon.width / 112 * this.scale;
    }": TypeError: Cannot read property 'width' of undefined (found in component: <icon>)
[Vue warn]: Error when evaluating expression "function height() {
      return this.icon.height / 112 * this.scale;
    }": TypeError: Cannot read property 'height' of undefined (found in component: <icon>)
[[Vue warn]: Error when evaluating expression "function box() {
      return '0 0 ' + this.icon.width + ' ' + this.icon.height;
    }": TypeError: Cannot read property 'width' of undefined (found in component: <icon>)
[Vue warn]: Error when evaluating expression "icon.d": TypeError: Cannot read property 'd' of undefined (found in component: <icon>)

Using vue 1.0.26

Any ideas?

Uncaught SyntaxError: Unexpected token import

First, I installed: npm install vue-awesome --save-dev

Then I added the following lines to main.js, based on the readme and example:

import Icon from 'vue-awesome/src/components/Icon.vue';
Vue.component('icon', Icon);

I get this error in the browser console:
> Uncaught SyntaxError: Unexpected token import Icon.vue?7cbb:36

Am I doing something incorrect? Thx!

Uncaught TypeError: plugin.apply is not a function

Hello, I got this error when trying to use vue-awesome.

Uncaught TypeError: plugin.apply is not a function
    at Function.Vue.use (eval at <anonymous> (app.js:123), <anonymous>:3428:14)
    at eval (eval at <anonymous> (app.js:7214), <anonymous>:40:45)
    at Object.<anonymous> (app.js:7214)
    at __webpack_require__ (app.js:20)
    at app.js:64
    at app.js:67

I'm using

  • Gulp
  • Elixir
  • Webpack

App.js

require('./bootstrap');
import App from './App.vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-default/index.css';
import Vue from 'vue'
import Icon from 'vue-awesome/components/Icon.vue'
import 'vue-awesome/icons'

Vue.use(ElementUI);
Vue.use(Icon);
const app = new Vue({
        el: '#app',
        render: h => h(App)
    });

gulpfile.js

const elixir = require('laravel-elixir');
const path = require('path');

require('laravel-elixir-vue-2');

elixir(function(mix) {

    Elixir.webpack.mergeConfig({
        resolveLoader: {
            root: path.join(__dirname, 'node_modules'),
        },
        module: {
            loaders: [
                {
                    test: /\.css$/,
                    loader: 'style!css'
                }
            ]
        }
    });
    
mix.sass([
        'app.scss',
]);

    mix.webpack('app.js');

});

Thank you for your help

IE11 Error

Hi,
In Ie11 i get
SCRIPT1002: Syntaxerror

I have 3 Views as Example:
Home, About and Contact

When i Include the the Plugin just in Contact the whole Page stops working

   import Icon from 'vue-awesome/components/Icon.vue'
    import 'vue-awesome/icons/twitter'
    import 'vue-awesome/icons/facebook'
    import 'vue-awesome/icons/send'

I cant find which file or debug damn ie11 it tells me something will be open.. but nothing happens because everything is crashed
Here a Screen:
https://gyazo.com/48e01c07daa21a267a2de4d9b58ff023
text comes from ssr

Weback Version "webpack": "^2.1.0-beta.20", i will try to update webpack i give report then i updated same
my .babelrc

{
  "presets": [
    ["es2015", { "modules": false }],    "stage-2"
  ],
  "plugins": ["transform-runtime"],
  "comments": false
}
and i use require('babel-polyfill')

Invalid prop: custom validator check failed for prop "name".

ERROR
image

webpack.config.js(v2.2.1)

{
    test: /\.js$/,
    loader: 'babel-loader',
    include: [resolve('src'), resolve('test'), resolve('node_modules/vue-awesome')],
    exclude: /node_modules(?![\\/]vue-awesome[\\/])/
},

main.js

import 'element-ui/lib/theme-default/index.css'
import '@/assets/css/base.scss'

import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import VueMoment from 'vue-moment'
import FaIcon from 'vue-awesome/components/Icon.vue'

Vue.component('fa-icon', FaIcon)

Vue.config.productionTip = false
Vue.use(ElementUI)
Vue.use(VueMoment)
new Vue({
    el: '#app',
    router,
    store,
    template: '<App/>',
    components: { App }
})

.vue

<fa-icon name="flag"></fa-icon>

Error building icons

Hi,
if I try to run nom run fa2json I see this error:

node build/fa2json.js

events.js:161
      throw er; // Unhandled 'error' event
      ^
TypeError: Cannot read property 'charCodeAt' of undefined
    at /Users/Sky/Documents/vue-awesome/node_modules/svgfont2js/index.js:56:39

What's I missing?
Thanks

Best regards

Minimize issue

When I run webpack build with Uglifyjs plugin or --optimize-minimize it gives me following error

ERROR in build.js from UglifyJs
SyntaxError: Unexpected token: name (warn) [./~/vue-awesome/util.js:3,0][build.js:...

When I run the build withput minification or dev Its working great.

I am importing the Icon in my components, I also tried the global import, still not working I tried ES5 and ES6

I am now importing like:

require('vue-awesome/icons/search');
require('vue-awesome/icons/times');
var Icon = require('vue-awesome/components/Icon.vue');

And then I define in module.exports

    components: {
        'icon': Icon
    },

It is working but only in dev builds, Am I missing something?

Clarification on correct import for loading individual icons?

Hi there,

The readme doesn't seem to be quite correct on the right way to load individual icons.

First of all,

According to the readme as it stands right now, the correct import statement to register the component is: import Icon from 'vue-awesome/components/Icon'. But even with vue-loader, that doesn't work at all. Instead, it seems to insist on being passed the .vue extension, or node can't find the component at all. import Icon from 'vue-awesome/components/Icon.vue' works fine.

Second, it doesn't seem to actually be importing single icons. I'm only importing 11 icons, and webpack-bundle-size-analyzer reports that vue-awesome is using a gigantic 477.76 KB---which has gotta be the entire thing.

Maybe I'm doing something wrong? I don't think so, but just in case, below is the relevant code I have...

import Icon from 'vue-awesome/components/Icon.vue';
Vue.component('icon', Icon);
import 'vue-awesome/icons/phone';
import 'vue-awesome/icons/certificate';
import 'vue-awesome/icons/cogs';
import 'vue-awesome/icons/file-text';
import 'vue-awesome/icons/external-link-square';
import 'vue-awesome/icons/download';
import 'vue-awesome/icons/times';
import 'vue-awesome/icons/file-pdf-o';
import 'vue-awesome/icons/envelope-o';
import 'vue-awesome/icons/list-ul';
import 'vue-awesome/icons/pencil';

cannot update icon on a conditional rendering

I have a toggle element which should be updated with the icon that is dependable on the dynamic property. On Very first render i get proper icon but when i toggle it the icon does not change at all but all other stuff is changed. This is only started to happen when i moved to svg icons(javascript). Is there work around to fix this issue?

Couldn't find any versions for "vue-awesome" that matches "^2.3.2"

Please can the latest version be published to npm so I can make use of the pulse prop?
I tried installing straight from the git repo but it's causing the following error my unit tests:
Uncaught Error: Module build failed: Error: Plugin 0 specified in "/home/my_user/my_project/node_modules/vue-awesome/.babelrc.env.test" provided an invalid property of "Instrumenter"
Fixing at the source would be ideal if possible.

Is it possible to import icons which you use without registering icons?

I care about the bundle size so I use import 'vue-awesome/icons/flag' instead of import 'vue-awesome/icons'.

However, I found I have to register the icon which I use in the demo.

So, I want to know is it possible to import icons auto?

Such as detecting the vue file for searching the icon which I use and inject auto ?

Thank you.

The vue-awesome is awesome !

This dependency was not found: * vue-awesome in ./src/main.js

I am facing issue about not able to have vue-awesome work for my webpack 2 vue application . I follow the instruction and done my setting according the following:
1>npm install --save vue-awesome
2>then in webpack,base.config.js
{
test: /.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/vue-awesome')] // include: [resolve('src'), resolve('test')]
},
3>and import in main.js
import Icon from 'vue-awesome'
Vue.use(Icon)

But still not working with error This dependency was not found: * vue-awesome in ./src/main.js

SSR Support

Hi,
I have the issue with importing component for SSR usage.
ReferenceError: document is not defined at /node_modules/vue-awesome/dist/vue-awesome.js:1:315
Could you please describe how to use font awesome with SSR correctly?

Update to Font Awesome 4.7

Want to use a new icon from 4.7 (fa-address-card-o) and it is not available in vue-awesome. Great project by the way!

request of a dependency is an expression

This recently started showing up in my console running the dev server with the official vue-cli
It is definitely vue-awesome related. Any ideas?

WARNING  Compiled with 1 warnings                                                                                                                                                                                        8:56:05 AM

 warning  in ./~/encoding/lib/iconv-loader.js

9:12-34 Critical dependency: the request of a dependency is an expression

Icon inside bootstrap button

Hi,

am using vue with bootstrap and trying add icon to bs button, but it appeared to be misaligned.
Id there any solution to this?

<button class="btn btn-outline-success my-2 my-sm-0" type="submit"><icon name="flag"></icon>Search</button>

2017-08-07_1017

npm>= 3.0.0

in some reason my npm is v2.15.11,so it can't work, what can i do to make it work?

Allow to use font awesome icons in pseudo classes

I'm trying to reference an icon like this:

.telephone:before{ font-family: FontAwesome; content: "\f095"; }

But this fails as it seems the actual icons are not in the font, but in separate .js files?
Is there a workaround to this?

[Vue warn]: Unknown custom element: <icon>

I'm using a "vue init simple" template (no webpack or anything), and have added
<script src="lib/js/vue-awesome.js"></script> (downloaded and placed at the given path beforehand), however I can't use it. I keep getting the following error:
[Vue warn]: Unknown custom element: <icon> - did you register the component correctly? For recursive components, make sure to provide the "name" option. (found in <Root>)

I started doubting myself, if I'm doing something wrong, but other packages (namely bootstrap-vue) seems to work without an issue.

Uglify.js chokes on Icon.vue [v2.3.1]

When bundling the assets of my project for production, Uglify seems to trip over something in Icon.vue:

error

/js/app.js from UglifyJs
Unexpected token: name (icons) [Icon.vue?8a3472bc:50,0][/js/app.js:11686,4]

Do you have any idea what this could be? Thanks!

Sweetalert case

Hello, thank you so much for creating this component!

I'm having trouble with this particular scenario:

I'm using the Icon component in almost every component I created,
except in this file

image

It seems, I need to use the fa fa-bug legacy class;

I don't want to include the font awesome library just for this,

There is something I can do to solve my problem?

Thanks in advance

Invalid Prop

[Vue warn]: Invalid prop: custom validator check failed for prop "name". (found in component <icon> at /var/www/html/vueApp/node_modules/vue-awesome/components/Icon.vue)

i am having this problem. what might be the solution?
i followed everything as in readme..!

Work with the Nuxt Framework

Hi, I am trying to make this work with the Nuxt Framework.
I added vue-awesome to nuxt.config.js
build: { vendor: ['vue-awesome'] }

When I insert an icon in a template it does not show, but it is there (in the dev tools).

Am I missing something?
Thanks.

Stacked icons

Not actually an issue but i didnt found a place to ask.

Can we use stacked icons like in fontawesome . Thanks

How do I load a complex svg with groups

I want to have register elements without manually having to pass strings of paths or polygons. If a have a complex SVG with groups, is there a way to import that file as a value of a key during icon registration. Is the only way to do this with something like this:

raw: require('./path/to/svg');

README out of date?

The README.md says to use this format when using webpack / vue-loader:

import Icon from 'vue-awesome/components/Icon.vue'

However, there's a parsing error when this happens: Uncaught SyntaxError: Unexpected token export. It's caused by this line:

export { warn }

This seems to be the correct way of importing the Icon component:

import Icon from 'vue-awesome'

Not sure if the README.md is out of sync.

Vue 2.0

In Vue 2.0 can write camelCase attributes, and .camel not working.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.