nuxt / icon

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

Issue with v-show on icons in 1.8.1 or 1.8.0 #301

Closed jrutila closed 1 week ago

jrutila commented 1 week ago

I have this kind of template:

        <span>
          <Icon
            v-show="!searching"
            name="i-heroicons-magnifying-glass-20-solid" />
          <Icon
            v-show="searching"
            name="i-heroicons-arrow-path-20-solid"
            class="animate-spin"
        /></span>

So, it should show magnifying-glass when not searching and arrow-path when searching. This does not work. Depending on if the view was loaded during navigation or page load it does not change or there a both. With v-if it works fine.

Here is a reproduction with nuxt-ui: https://stackblitz.com/edit/nuxt-ui-7zcwsg?file=app.vue,package.json

And here is a reproduction from nuxt-icon-playground: https://stackblitz.com/edit/nuxt-icon-playground-odkjmz?file=app.vue,package.json

It works with 1.7.6 but not 1.8.0 onwards. Could this be related to #300 ?


❯ npx nuxt info
Working directory: /home/projects/nuxt-ui                                                                                                             
Nuxt project info:                                                                                                                                    

------------------------------
- Operating System: Linux
- Node Version:     v18.20.3
- Nuxt Version:     3.14.159
- CLI Version:      3.15.0
- Nitro Version:    2.10.4
- Package Manager:  pnpm@8.15.6
- Builder:          -
- User Config:      default
- Runtime Modules:  @nuxt/ui@2.19.2
- Build Modules:    -
------------------------------