mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-12 13:38:32 +00:00
docs(dev): Fix code sample for vanilla JS (#3836)
* Fix code sample for vanilla JS The .append method of elements takes plain text, not HTML. This updates the code to use .insertAdjacentHTML instead. * Update createLabCodeExamples.ts * fix(site): update createCodeExamples.ts vanilla JS code example * Update createLabCodeExamples.ts * Update createCodeExamples.ts * Update createCodeExamples.ts --------- Co-authored-by: Karsa <contact@karsa.org>
This commit is contained in:
@@ -10,10 +10,11 @@ type CodeExampleType = {
|
||||
const getIconCodes = (): CodeExampleType => {
|
||||
return [
|
||||
{
|
||||
language: 'js',
|
||||
language: 'html',
|
||||
title: 'Vanilla',
|
||||
code: `\
|
||||
import { createIcons, icons } from 'lucide';
|
||||
<script>
|
||||
import { createIcons } from 'lucide';
|
||||
import { $CamelCase } from '@lucide/lab';
|
||||
|
||||
createIcons({
|
||||
@@ -21,8 +22,9 @@ createIcons({
|
||||
$CamelCase
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
document.body.append('<i data-lucide="$Name"></i>');\
|
||||
<i data-lucide="$Name"></i>\
|
||||
`,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user