I want to use Google Material Design Icon Font in my vue3.0 project where I also use vuetify 3.0.
The steps I followed to achieve this are:
In
main.ts
file, set the default icon tomd
(imported from vuetify iconsets)Use google icon name in the vuetify component
v-btn
. Here,picture_as_pdf
is the name of google material disign icon.<v-btn rounded="pill" class="bg-lightgrey ma-2" prepend-icon="picture_as_pdf" @click="emit('generateReport')" > Export </v-btn>
It will show you a filled version of icon.
Everything is good till now. But I want to use both outlined as well as filled version of google material design icon.
I have solution for this problem but it is not working with vuetify component. Does anyone have any solution for this?
Sharing my solution with you all which is working fine with normal html tags but not working with vuetify components.
Steps:
Add the cdn link (for filled and outlined both) to the html file
<link href="https://fonts.googleapis.com/css? family=Material+Icons|Material+Icons+Outlined" rel="stylesheet" />
In the component template
<span class="material-icons">face</span> <span class="material-icons-outlined">face</span>
NOTE: It worked well but when I use it in vuetify component let's say v-btn
, it is not working.