Skip to content

Commit

Permalink
fix: replace path to relative in vc-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
NaMax66 committed Dec 27, 2024
1 parent a62a2a9 commit 3376aaf
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions client-app/ui-kit/components/atoms/icon/vc-icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<script setup lang="ts">
import DOMPurify from "dompurify";
import { ref, computed, watch } from "vue";
import { Logger } from "@/core/utilities";
interface IProps {
name?: string;
Expand All @@ -29,8 +30,17 @@ const style = computed(() =>
const sizeClass = computed(() => (typeof props.size === "string" ? `vc-icon--size--${props.size}` : ""));
async function loadIcon(name?: string) {
const response = (await import(`@/assets/icons/basic/${name}.svg?raw`)) as { default: string };
icon.value = DOMPurify.sanitize(response.default);
if (name) {
try {
const response = (await import(`../../../../assets/icons/basic/${name}.svg?raw`)) as { default: string };
icon.value = DOMPurify.sanitize(response.default);
} catch (error) {
Logger.error(`Failed to load icon: ${name}`, error);
icon.value = "";
}
} else {
icon.value = "";
}
}
watch(
Expand Down

0 comments on commit 3376aaf

Please sign in to comment.