Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font awesome spinner not spinning

I have completed an installation of fontawesome in Nuxt with this fantastic link;

https://github.com/FortAwesome/vue-fontawesome

I have a spinner rendered as

<font-awesome-icon :icon="['fas','spinner']" />

The spinner does not spin, it is static.

I added fa-spin as

<font-awesome-icon :icon="['fas','spinner', 'spin']" />

This caused the error in the console Could not find one or more icon(s) undefined

Can anyone point me in the right direction, show me how to get my spinner spinning.

The relevant portion on the nuxt.config.js

    modules: [
        'nuxt-fontawesome'
],


//font-awesome
  fontawesome: {
    imports: [
        {
          set: '@fortawesome/free-solid-svg-icons',
          icons: ['fas']
        },
    ],
  },

build: {
      config.resolve.alias['@fortawesome/fontawesome-free-brands$'] = '@fortawesome/fontawesome-free-brands/shakable.es.js'
      config.resolve.alias['@fortawesome/fontawesome-free-solid$'] = '@fortawesome/fontawesome-free-solid/shakable.es.js'
    }

In the component("../pages/index.vue") it is;

<template>
  <div>
    <font-awesome-icon :icon="['fas','spinner','spin' ]" />
  </div>
</template>

As suggested by @Steve, i have created a Glitch workspace https://glitch.com/edit/#!/join/d57a5054-b448-4a53-ad37-d9465b0cef8b

like image 622
BlowMan Avatar asked Sep 07 '18 15:09

BlowMan


People also ask

How do you make font awesome spin?

Use the fa-spin class to get any icon to rotate, and use fa-pulse to have it rotate with eight steps. This works especially well with fa-spinner & everything in the spinner icons category.

What is @fortawesome?

Font Awesome is the Internet's icon library and toolkit, used by millions of designers, developers, and content creators.

Does Font Awesome have animated icons?

Do More with Font Awesome Pro! Upgrade now and rev up your productivity with more icons, styles, and tools. We'll cover the basics of animations like beat, fade, beat-fade, flip, and spin to your icons, so that you can create more visual interest on your site.


1 Answers

You can add the spin directive.

<font-awesome-icon icon="spinner" spin />

Docs: https://github.com/FortAwesome/vue-fontawesome#basic

like image 174
el.mano.el Avatar answered Sep 27 '22 21:09

el.mano.el