nuxt / icon

The <Icon> component, supporting Iconify, Emojis and custom components.
https://stackblitz.com/edit/nuxt-icon-playground?file=app.vue
MIT License
868 stars 37 forks source link

fix: support undefined app.config `nuxtIcon` #113

Closed pixelastronauts closed 8 months ago

pixelastronauts commented 8 months ago

Resolves #100

Problem

While accessing properties of nuxtIcon, the application would throw a TypeError if nuxtIcon was undefined.

Solution

Added optional chaining (?.) to safely access the nested properties of nuxtIcon.

Changes

what-the-diff[bot] commented 8 months ago

PR Summary

xin0907 commented 8 months ago

I've had this problem too and I think you're right.

harlan-zw commented 8 months ago

Thanks, going to merge this as it's blocking me as well.

Edit: Turns out I can't publish releases for nuxt-icon so will need to wait for @Atinux or someone else to bump

Atinux commented 8 months ago

Sorry about this, just released as 0.6.1