Capítulo 9 de 147
Learn how to include Lucide icons inside HTML template elements using the inTemplates option.
createIcons function with template elementimport { createIcons, Backpack } from 'lucide/dist/cjs/lucide';
import "./styles.css";
createIcons({
icons: {
Backpack,
},
inTemplates: true
});
const container = document.getElementById("container");
const template = document.getElementById("template");
const firstClone = document.importNode(template.content, true);
container.appendChild(firstClone);
const secondClone = document.importNode(template.content, true);
container.appendChild(secondClone);
createIcons function with template element