pyplacca
pyplacca
NNuxt
Created by Yveeven on 9/2/2024 in #❓・help
When using the i18n module to switch languages, you need to refresh the page to take effect.
Try this
const { locale, locales, setLocaleCookie } = useI18n()
const switchLocalePath = useSwitchLocalePath()

function changeLanguage(code: string): void {
setLocaleCookie(code)
navigateTo(switchLocalePath(code), {
replace: true,
})
}
const { locale, locales, setLocaleCookie } = useI18n()
const switchLocalePath = useSwitchLocalePath()

function changeLanguage(code: string): void {
setLocaleCookie(code)
navigateTo(switchLocalePath(code), {
replace: true,
})
}
5 replies
NNuxt
Created by typeshit on 6/5/2024 in #❓・help
env How can i use env variables in a .js file ?
Prefix the variables with VITE_ and access them via import.meta.env
16 replies
NNuxt
Created by localhostess on 5/23/2024 in #❓・help
Hydration mismatch for breakpoints
If the component isn’t needed to be rendered on the server side, you could wrap it in the client-only component
6 replies
NNuxt
Created by diez on 5/23/2024 in #❓・help
NavigateTo('/path') navigating but not displaying path
Welcome
5 replies
NNuxt
Created by Jan382 on 5/23/2024 in #❓・help
How to connect Carousel, Swiper correctly?
What have you tried?
6 replies
NNuxt
Created by diez on 5/23/2024 in #❓・help
NavigateTo('/path') navigating but not displaying path
You have a template inside a template in your index.vue page
5 replies
NNuxt
Created by ZombiEquinox on 5/21/2024 in #❓・help
Using Web Components with Nuxt 3.8.2
Here’s an example of how I got the swiper web components working in my app
5 replies
NNuxt
Created by ZombiEquinox on 5/21/2024 in #❓・help
Using Web Components with Nuxt 3.8.2
You’d want to tell nuxt which components it should recognize as custom web components via the vue.compilerOptions option in your nuxt.config.ts file
5 replies
NNuxt
Created by ZombiEquinox on 5/21/2024 in #❓・help
Using Web Components with Nuxt 3.8.2
This should help you get web components working in nuxt. https://vuejs.org/guide/extras/web-components.html
5 replies
NNuxt
Created by Muhammad Awais on 5/19/2024 in #❓・help
Insert html in head
I don’t know if this would work but you can try it out. If it does work, I would think it’s safe or recommended either.
<template>
<div>
<Head v-html="your_html_string"/>

</div>
</template>
<template>
<div>
<Head v-html="your_html_string"/>

</div>
</template>
https://nuxt.com/docs/getting-started/seo-meta#components
14 replies
NNuxt
Created by Muhammad Awais on 5/19/2024 in #❓・help
Insert html in head
Yhh. That’s one let down with cheerio
14 replies
NNuxt
Created by Muhammad Awais on 5/19/2024 in #❓・help
Insert html in head
What if you parsed the string, extracted the parts you need, and then inserting them into the head using the composable? You can use cheerio to handle the parsing. PS: cheerio can be slow sometimes, but it’s useful for such SSR needs
14 replies
NNuxt
Created by Muhammad Awais on 5/19/2024 in #❓・help
Insert html in head
You’d usually insert as is. Check the usage section
14 replies
NNuxt
Created by BloodBunn on 5/12/2024 in #❓・help
Supabase url is required
Oh that’s cool. It’s unfortunate that you had to struggle through it, but I’m glad you’ve found a solution and made progress
32 replies
NNuxt
Created by Muhammad Awais on 5/19/2024 in #❓・help
Insert html in head
14 replies
NNuxt
Created by BloodBunn on 5/12/2024 in #❓・help
Supabase url is required
Is useSupabasClient your custom composable?
32 replies
NNuxt
Created by BloodBunn on 5/12/2024 in #❓・help
Supabase url is required
Ah right 👍
32 replies
NNuxt
Created by BloodBunn on 5/12/2024 in #❓・help
Supabase url is required
No description
32 replies
NNuxt
Created by BloodBunn on 5/12/2024 in #❓・help
Supabase url is required
I’m aware of this, but I’m not sure why the bite prefix suggestion wasn’t working for you
32 replies
NNuxt
Created by BloodBunn on 5/12/2024 in #❓・help
Supabase url is required
If you want to access your env variables directly in your js files, you’d want to do the following 1. Prefix the env key with VITE_ 2. Access the variable from import.meta.env.{KEY}
32 replies