boxicons
boxicons copied to clipboard
How use in vue components?
Tell me how I can use icons in a project with a vue3
?
First, install boxicons via npm, not cdn.
npm install boxicons --save
Then import Boxicons in the script section of your App.vue.
import 'boxicons';
Done. It should be now accessible everywhere in your Vue App like this.
<template>
<box-icon name="save"></box-icon>
</template>
I see the following warning in the console
[Vue warn]: Failed to resolve component: box-icon
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
using Vue 3 + TS
I see the following warning in the console
[Vue warn]: Failed to resolve component: box-icon If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
using Vue 3 + TS
You can solve the problem by following this answer: https://stackoverflow.com/a/71602929