Skip to content

Commit

Permalink
fix(icon): use optional chaining to fix 'undefined' error in Histoire (
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertHaba committed Mar 20, 2024
1 parent 953763f commit d579df5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/Icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const iconName = computed(() => {
const resolvedIcon = computed(() => resolveIconName(iconName.value))
const iconKey = computed(() => [resolvedIcon.value.provider, resolvedIcon.value.prefix, resolvedIcon.value.name].filter(Boolean).join(':'))
const icon = computed<IconifyIcon | undefined>(() => state.value?.[iconKey.value])
const component = computed(() => nuxtApp.vueApp.component(iconName.value))
const component = computed(() => nuxtApp.vueApp?.component(iconName.value))
const sSize = computed(() => {
// Disable size if appConfig.nuxtIcon.size === false
// @ts-ignore
Expand Down

0 comments on commit d579df5

Please sign in to comment.