fix: rename the Icon component to IconifyIcon to prevent name conflicts and fix type issues (#4704)

This commit is contained in:
Vben
2024-10-21 20:14:25 +08:00
committed by GitHub
parent 88d2b3e569
commit 1b172b0329
16 changed files with 74 additions and 54 deletions

View File

@@ -1,2 +1,2 @@
export * from './iconify/index';
export * from './svg/index';
export * from './iconify/index.js';
export * from './svg/index.js';

View File

@@ -1,6 +1,6 @@
import { createIconifyIcon } from '@vben-core/icons';
import './load';
import './load.js';
const SvgAvatar1Icon = createIconifyIcon('svg:avatar-1');
const SvgAvatar2Icon = createIconifyIcon('svg:avatar-2');

View File

@@ -1,4 +1,6 @@
import { addIcon, type IconifyIcon } from '@vben-core/icons';
import type { IconifyIconStructure } from '@vben-core/icons';
import { addIcon } from '@vben-core/icons';
let loaded = false;
if (!loaded) {
@@ -6,7 +8,7 @@ if (!loaded) {
loaded = true;
}
function parseSvg(svgData: string): IconifyIcon {
function parseSvg(svgData: string): IconifyIconStructure {
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(svgData, 'image/svg+xml');
const svgElement = xmlDoc.documentElement;