mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-17 14:28:25 +00:00
26 lines
572 B
TypeScript
26 lines
572 B
TypeScript
import { h } from 'vue';
|
|
import { IconNode, LucideIcon } from './types';
|
|
import Icon from './Icon';
|
|
|
|
/**
|
|
* Create a Lucide icon component
|
|
* @param {string} iconName
|
|
* @param {array} iconNode
|
|
* @returns {FunctionalComponent} LucideIcon
|
|
*/
|
|
const createLucideIcon =
|
|
(iconName: string, iconNode: IconNode): LucideIcon =>
|
|
(props, { slots, attrs }) =>
|
|
h(
|
|
Icon,
|
|
{
|
|
...attrs,
|
|
...props,
|
|
iconNode,
|
|
name: iconName,
|
|
},
|
|
slots.default ? { default: slots.default } : undefined,
|
|
);
|
|
|
|
export default createLucideIcon;
|