Open mshishkov opened 1 year ago
################################ index.hml ####################################### <!DOCTYPE html> <html> <head> <title>Test</title> </head> <body> <div id="app"> Element not rendered: <span v-html="faElem"></span> <br> While simple usage is working: <fa icon="fa-solid fa-envelope" /> </div> <script src="js/app.js"></script> </body> </html>
################################ app.js ####################################### import './bootstrap'; import { createApp } from 'vue'; // FontAwesome import { library } from '@fortawesome/fontawesome-svg-core'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import { faEnvelope } from '@fortawesome/free-solid-svg-icons'; library.add(faEnvelope); createApp({ data() { return { faElem: `<fa icon="fa-solid fa-envelope" />` } } }) .component('fa', FontAwesomeIcon) .mount('#app');
That's what rendered
This behaviour is intended by Vue and is not related to FA. A google search like "v-html with components" could help you to try a different approach. How to use components in v-html
That's what rendered![image](https://user-images.githubusercontent.com/8350013/200074749-8230c918-80cd-4511-8cb6-60a633023abb.png)