create-icon.ts 311 B

1234567891011121314
  1. import { defineComponent, h } from 'vue';
  2. import { Icon } from '@iconify/vue';
  3. function createIconifyIcon(icon: string) {
  4. return defineComponent({
  5. name: `Icon-${icon}`,
  6. setup(props, { attrs }) {
  7. return () => h(Icon, { icon, ...props, ...attrs });
  8. },
  9. });
  10. }
  11. export { createIconifyIcon };