Romi
Romi
Explore posts from servers
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
maybe let me check I am using Storyblok api to fetch data
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
strange
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
No description
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
hmm when I added
routeRules: {
"/**": { prerender: true },
}
routeRules: {
"/**": { prerender: true },
}
it broke my site lol
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
having troubles trying to implemet this
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
So is your SSR set to true?
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
Thanks, so does this allow each page to have its own meta date?
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
what did you end up choosing
40 replies
NNuxt
Created by Romi on 7/22/2023 in #❓・help
Can't scroll on Mobile Menu using Nuxt-Link
thanks @TaymaZ that worked
watch(mobileNav, (value) => {
if (value) {
document.body.style.overflow = 'visible';
}
});
watch(mobileNav, (value) => {
if (value) {
document.body.style.overflow = 'visible';
}
});
was there a better way to actualy make a mobile menu like this, feel like this should not be the default behaviour lol
7 replies
NNuxt
Created by Romi on 7/22/2023 in #❓・help
Can't scroll on Mobile Menu using Nuxt-Link
thanks let me try this
7 replies
NNuxt
Created by Romi on 7/22/2023 in #❓・help
Can't scroll on Mobile Menu using Nuxt-Link
still havent be able to sort this 😦
7 replies
NNuxt
Created by Romi on 7/22/2023 in #❓・help
Can't scroll on Mobile Menu using Nuxt-Link
Script
const mobileNav = ref(false);

const openMobileNav = () => {
console.log('open');
mobileNav.value = true;
document.body.style.overflow = 'hidden';
};

const closeMobileNav = () => {
console.log('close');
mobileNav.value = false;
document.body.style.overflow = 'visible'; // Reset the overflow property to its default value
};
const mobileNav = ref(false);

const openMobileNav = () => {
console.log('open');
mobileNav.value = true;
document.body.style.overflow = 'hidden';
};

const closeMobileNav = () => {
console.log('close');
mobileNav.value = false;
document.body.style.overflow = 'visible'; // Reset the overflow property to its default value
};
7 replies
NNuxt
Created by Romi on 7/22/2023 in #❓・help
Can't scroll on Mobile Menu using Nuxt-Link
<div v-if="mobileNav" class="fixed inset-0 z-50 flex flex-col py-8 mx-auto bg-primary-d h-scren">
<div class="container flex justify-between w-full px-4 mx-auto">
<NuxtLink to="/">
<img class="w-full h-10 m-auto" :src="siteLogo.filename" alt="">
</NuxtLink>
<div>
<button @click="closeMobileNav"
class="p-2 text-black rounded-full bg-gradient-to-r from-primary to-secondary">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>

</button>
</div>

</div>
<div class="my-12 border opacity-60 border-primary-l "></div>
<nav class="container px-4 mx-auto " v-if="headerMenu">
<ul class="space-y-8 text-lg font-medium text-white">
<li class="my-auto" v-for="blok in headerMenu" :key="blok._uid">
<NuxtLink :to="`/${blok.link.cached_url}`" class="hover:text-[#50b0ae] my-auto">
{{ blok.link.story.name }}
</NuxtLink>
</li>

</ul>
<div class="my-8 space-y-5">
<div v-for="action in quote">
<StoryblokComponent class="w-full" :blok="action" />
</div>
<div v-for="action in contact">
<StoryblokComponent class="w-full" :blok="action" />
</div>
</div>
</nav>
</div>
<div v-if="mobileNav" class="fixed inset-0 z-50 flex flex-col py-8 mx-auto bg-primary-d h-scren">
<div class="container flex justify-between w-full px-4 mx-auto">
<NuxtLink to="/">
<img class="w-full h-10 m-auto" :src="siteLogo.filename" alt="">
</NuxtLink>
<div>
<button @click="closeMobileNav"
class="p-2 text-black rounded-full bg-gradient-to-r from-primary to-secondary">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>

</button>
</div>

</div>
<div class="my-12 border opacity-60 border-primary-l "></div>
<nav class="container px-4 mx-auto " v-if="headerMenu">
<ul class="space-y-8 text-lg font-medium text-white">
<li class="my-auto" v-for="blok in headerMenu" :key="blok._uid">
<NuxtLink :to="`/${blok.link.cached_url}`" class="hover:text-[#50b0ae] my-auto">
{{ blok.link.story.name }}
</NuxtLink>
</li>

</ul>
<div class="my-8 space-y-5">
<div v-for="action in quote">
<StoryblokComponent class="w-full" :blok="action" />
</div>
<div v-for="action in contact">
<StoryblokComponent class="w-full" :blok="action" />
</div>
</div>
</nav>
</div>
7 replies
NNuxt
Created by Romi on 7/6/2023 in #❓・help
Pinia, Local Storage ... :(
just nuxt wont read from my local storage but it will write to it 😦
18 replies
NNuxt
Created by Romi on 7/6/2023 in #❓・help
Pinia, Local Storage ... :(
export const useCartStore = defineStore('cart', {
state: () => ({
id: nuxtStorage.localStorage.getData('cartId') || 'helo',
}),
getters: {
cartId: () => nuxtStorage.localStorage.getData('cartId'),
},
actions: {
setCartId(id) {
this.id = id;
nuxtStorage.localStorage.setData('cartId', id);
},
},
});
export const useCartStore = defineStore('cart', {
state: () => ({
id: nuxtStorage.localStorage.getData('cartId') || 'helo',
}),
getters: {
cartId: () => nuxtStorage.localStorage.getData('cartId'),
},
actions: {
setCartId(id) {
this.id = id;
nuxtStorage.localStorage.setData('cartId', id);
},
},
});
`
18 replies
NNuxt
Created by Romi on 7/6/2023 in #❓・help
Pinia, Local Storage ... :(
sorry I don't know what that means lol
18 replies
NNuxt
Created by Romi on 7/6/2023 in #❓・help
Pinia, Local Storage ... :(
here?
watch(
() => store.id,
(newId) => {
localStorage.setItem('cartId', JSON.stringify(newId));
},
{ deep: true }
);
watch(
() => store.id,
(newId) => {
localStorage.setItem('cartId', JSON.stringify(newId));
},
{ deep: true }
);
18 replies
NNuxt
Created by Romi on 7/6/2023 in #❓・help
Pinia, Local Storage ... :(
I think the issue is here to get the local storage data
import { defineStore } from 'pinia';
import nuxtStorage from 'nuxt-storage';

// You can name the return value of `defineStore()` anything you want,
// but it's best to use the name of the store and surround it with `use`
// and `Store` (e.g. `useUserStore`, `useCartStore`, `useProductStore`)
// the first argument is a unique id of the store across your application
export const useCartStore = defineStore('cart', {
state: () => ({
id: nuxtStorage.localStorage.getData('cartId') || null,
}),
});
import { defineStore } from 'pinia';
import nuxtStorage from 'nuxt-storage';

// You can name the return value of `defineStore()` anything you want,
// but it's best to use the name of the store and surround it with `use`
// and `Store` (e.g. `useUserStore`, `useCartStore`, `useProductStore`)
// the first argument is a unique id of the store across your application
export const useCartStore = defineStore('cart', {
state: () => ({
id: nuxtStorage.localStorage.getData('cartId') || null,
}),
});
`
18 replies
NNuxt
Created by Romi on 7/6/2023 in #❓・help
Pinia, Local Storage ... :(
yeah I seen this and tried
watch(
() => store.id,
(newId) => {
localStorage.setItem('cartId', JSON.stringify(newId));
},
{ deep: true }
);
watch(
() => store.id,
(newId) => {
localStorage.setItem('cartId', JSON.stringify(newId));
},
{ deep: true }
);
problem is its setting to local storage but I cant get it
18 replies
NNuxt
Created by Romi on 7/6/2023 in #❓・help
Pinia, Local Storage ... :(
Yes same issue
18 replies