Omnislash
Omnislash
NNuxt
Created by Kilisei on 1/22/2025 in #❓・help
Nuxt nested layout
Hello I have exactly the same question I think ^^ Let's say I have 3 elements on my page : - menu - submenu - page I want my menu to be there no matter what, but my submenu only on certain pages What I would like to do is something like : - menu.vue (layout) - submenu.vue (layout) that includes the menu - page.vue (page) that includes the submenu (and thus the menu) In your solution, what I would need to do is either : - Add a condition to load the submenu depending on the page/route - Add the menu in my layouts The first solution feels clonky with extra verification. The second is "fine", I would have the menu as a code repetition, but by making it a component at least the modifications will be centralized Is there a way to nest layouts, or should I treat the "menu" layout as a component and include it in all my layouts ? Thanks 🙂
10 replies
NNuxt
Created by lpmagal on 11/29/2024 in #❓・help
dumb question: cache usage with useFetch
I think it's best to look at it this way : If it's light without that much navigation, trust at first and see how it goes If it's specific with a lot of navigation and enough data so you want to limitate stuff, and build a quick one with pinia ? Or still easy enough to do your own anyway, just have to be more promise conscious
39 replies
NNuxt
Created by lpmagal on 11/29/2024 in #❓・help
dumb question: cache usage with useFetch
you can use pinia then
39 replies
NNuxt
Created by lpmagal on 11/29/2024 in #❓・help
dumb question: cache usage with useFetch
It's not a big deal to dev if you don't mind SSR compatiblity (if yes, there is some more subtilities) and you'll have the comportment you seek
39 replies
NNuxt
Created by lpmagal on 11/29/2024 in #❓・help
dumb question: cache usage with useFetch
Had the same problem month ago. I don't know if it's a good idea but I strongly wanted to have my hand on the data and strop firing fetch all the time. I didn't want to use pinia for other reasons, so I just developped a little fetch abstraction that store the calls in a dictionnary using the endpoint as the key for the get. If I call it again, it'll return me the dictionnary first, and refresh it at the same time if I want to
39 replies
NNuxt
Created by Kaloyanes on 1/3/2025 in #❓・help
Is there a way to create a dynamic payload for static site?
Oh ok just understood the question :x Indeed CROS is server-side @Kaloyanes I do use Notion as a CMS myself so it works, but I guess they prevent it from the browser since you should never use your access or API Keys from you front That being said, the notion api response time is underwhelming, especially since you usually need more than one call to have all the info you want to display on one page, so I ended up using postgres as a "cache"
26 replies
NNuxt
Created by Hugo on 1/5/2025 in #❓・help
Nuxt ui Custom Color doesn't work
No idea sorry :/, I just use @apply from time to time and it works well Since your exemple is with primary maybe it's the same reason ? did you try with others ?
9 replies
NNuxt
Created by Hugo on 1/5/2025 in #❓・help
Nuxt ui Custom Color doesn't work
Likewise, you can't define a primary color in your tailwind.config.ts as it would conflict with the primary color defined by the module.
Likewise, you can't define a primary color in your tailwind.config.ts as it would conflict with the primary color defined by the module.
https://ui.nuxt.com/getting-started/theming
9 replies
NNuxt
Created by Hugo on 1/5/2025 in #❓・help
Nuxt ui Custom Color doesn't work
Hello, You can't call your primary primary, it conflicts with nuxt ui primary.
9 replies
NNuxt
Created by Kaloyanes on 1/3/2025 in #❓・help
Is there a way to create a dynamic payload for static site?
Can you share the utils code that gets the runtime config ?
26 replies
NNuxt
Created by Kaloyanes on 1/3/2025 in #❓・help
Is there a way to create a dynamic payload for static site?
The utils itself is not indeed if i remember correctly, but it doesn't mean you can't call it from a nuxt context, like a component script setup for exemple
26 replies
NNuxt
Created by Kaloyanes on 1/3/2025 in #❓・help
Is there a way to create a dynamic payload for static site?
Are you sure you call it from a nuxt context ? You have an error pour an empty runtime config ?
26 replies
NNuxt
Created by Kaloyanes on 1/3/2025 in #❓・help
Is there a way to create a dynamic payload for static site?
That being said, you have a public and a private env. You can access the public env on the client side. It's here in runtime config : https://nuxt.com/docs/guide/going-further/runtime-config You just have to prefix the variable with NUXT_PUBLIC_
26 replies
NNuxt
Created by Kaloyanes on 1/3/2025 in #❓・help
Is there a way to create a dynamic payload for static site?
My bad ofc it doesn't work, I use nuxt just as a front, so fetch works but it indeed fetches data from elsewhere ^^""" I would argue you indeed can't have the server side in any static hosting. So if cpanel only does static hosting.....
26 replies
NNuxt
Created by Kaloyanes on 1/3/2025 in #❓・help
Is there a way to create a dynamic payload for static site?
that being said, why is the kappa answer not ok for you ? It does fetch the content with a static website without using nitro isn't it ?
26 replies
NNuxt
Created by Kaloyanes on 1/3/2025 in #❓・help
Is there a way to create a dynamic payload for static site?
I understand it's not the answer your are expecting, but you might want to consider cloudflare pages instead ? It's free up to pretty far and you'll most likely have less deployment restrictions ?
26 replies
NNuxt
Created by Hugo on 1/2/2025 in #❓・help
nuxtui tailwind plugin
That being said IIRC nuxt ui v2 comes with tailwind v3 If you do need tailwind v4 you can give a try to nuxt ui v3 : npx nuxi@latest init -t ui3 <my-app>
30 replies
NNuxt
Created by Hugo on 1/2/2025 in #❓・help
nuxtui tailwind plugin
Hello What is not working exactly for you to think it's being ignored ? Everything Kappa AI tells you so far is kind of "if it doesn't work" or without nuxt ui On my side, it works just by installing nuxt ui
30 replies
NNuxt
Created by Omnislash on 12/29/2024 in #❓・help
Redirect all routes to /
When I try to redirect '/' to false, it says "Type 'false' is not assignable to type 'string | { to?: string | undefined; statusCode?: HTTPStatusCode | undefined; } | undefined'"
5 replies
NNuxt
Created by Omnislash on 12/15/2024 in #❓・help
Wrapping useToast
Thanks for your answer 🙂 I tried but I seem unable to import from 'vue-toastification' Am I suppose to install anything or it should be part of nuxt already ?
7 replies