nuxt-icons icon indicating copy to clipboard operation
nuxt-icons copied to clipboard

How can it be loaded on demand?

Open cdwmhcc opened this issue 3 years ago • 2 comments

This scheme will write all svg to nuxticons.mjs file, my project has several thousand svg icons, nuxticons.mjs file will be over 5mb.

How can it be loaded on demand?

cdwmhcc avatar Jun 22 '22 13:06 cdwmhcc

Hello! Currently it is not possible, I am still working on it and in the future I hope to succeed. In previous versions (without vite) it was much simpler

gitFoxCode avatar Jul 04 '22 07:07 gitFoxCode

  1. create file /server/api/getIcon.ts
  2. create file /components/icon.tsx

Get the content of the svg icon through the server-side getIcon.ts api. Render svg icon via component icon.txs.

Are there any downsides to this scheme?

cdwmhcc avatar Jul 09 '22 20:07 cdwmhcc

@cdwmhcc New version on nuxt 3.0.0 is now available, I encourage you to test it 😄

gitFoxCode avatar Nov 17 '22 14:11 gitFoxCode

@cdwmhcc New version on nuxt 3.0.0 is now available, I encourage you to test it 😄

Wow, crazy, I'll test it later 👍👍👍

cdwmhcc avatar Nov 18 '22 02:11 cdwmhcc