Vuetify Font awesome SVG integration problem

Viewed 227

I am trying to get component from vuetify working. I am using fontawesome svg icons and i followed the docs regarding installation page. Here is how i got it registered:

import Vue from "vue";
import Vuetify from "vuetify";
import "vuetify/dist/vuetify.min.css";

import { library } from "@fortawesome/fontawesome-svg-core";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { fas, faBell } from "@fortawesome/free-solid-svg-icons";

Vue.component("font-awesome-icon", FontAwesomeIcon); // Register component globally
library.add(fas, faBell); // Include needed icons

Vue.use(Vuetify);

export default new Vuetify({
  icons: {
    iconfont: "faSvg",
  },
});

However when I am using code such as this :

 <v-icon>fas fa-bell</v-icon>

for displaying icons it does not work. I got it working by using the font-awesome-icon component but i would like to use the native vuetify v-icon component.

Do you guys have any idea what might be the issue?

Thank you.

1 Answers

Looks like you're missing the link in your <head>. If you read the Vuetify docs you'll see:

The easiest way to get started with FontAwesome is to use a cdn. Within the head of your main index.html place this snippet: <link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">

Even if it doesn't specify the same for the SVG version, I only got it to work by adding that link to my <head>.

Related