mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-13 13:48:26 +00:00
* Remove old vue 2 package * Add @lucide/vue package * Remove old vue 2 doc * Update docs * Adjust export template * Adjust vue package! * Fix tests * Format code * Update packages/vue/src/Icon.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Adjust vue package in docs * Update deadlinks --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
29 lines
639 B
TypeScript
29 lines
639 B
TypeScript
import { h } from 'vue';
|
|
import type { FunctionalComponent } from 'vue';
|
|
import { IconNode, LucideProps } from './types';
|
|
import Icon from './Icon';
|
|
|
|
// Create interface extending SVGAttributes
|
|
|
|
/**
|
|
* Create a Lucide icon component
|
|
* @param {string} iconName
|
|
* @param {array} iconNode
|
|
* @returns {FunctionalComponent} LucideIcon
|
|
*/
|
|
const createLucideIcon =
|
|
(iconName: string, iconNode: IconNode): FunctionalComponent<LucideProps> =>
|
|
(props, { slots, attrs }) =>
|
|
h(
|
|
Icon,
|
|
{
|
|
...attrs,
|
|
...props,
|
|
iconNode,
|
|
name: iconName,
|
|
},
|
|
slots,
|
|
);
|
|
|
|
export default createLucideIcon;
|