mahiro mahiro mahiro
mahiro mahiro mahiro
Explore posts from servers
NNuxt
Created by mahiro mahiro mahiro on 4/12/2024 in #❓・help
Nuxt weird error: Cannot destructure property 'type' of 'vnode' as it is null
sr guys i actually solve.
3 replies
NNuxt
Created by mahiro mahiro mahiro on 3/31/2024 in #❓・help
Ways to have local middleware inside server/
import { getServerSession } from "#auth"; import Cart from "~/server/models/cart.schema"; import mongoose from "mongoose"; const appConfig = useAppConfig(); export default defineEventHandler(async (event) => { const session = await getServerSession(event); if (!session) { throw createError(appConfig.error.unauthorized); } currently this is my setup
7 replies
NNuxt
Created by mahiro mahiro mahiro on 3/31/2024 in #❓・help
Ways to have local middleware inside server/
7 replies
NNuxt
Created by mahiro mahiro mahiro on 3/31/2024 in #❓・help
Ways to have local middleware inside server/
it's not long but i don't think copy and paste is a really good practice
7 replies
NNuxt
Created by mahiro mahiro mahiro on 3/31/2024 in #❓・help
Ways to have local middleware inside server/
cuz i use sidebase auth and the way to handling auth is just getServerSession(event). -> if (!session) throw createError(...)
7 replies
NNuxt
Created by mahiro mahiro mahiro on 3/31/2024 in #❓・help
Ways to have local middleware inside server/
i plan to do that also. i plan to put it into utils to have a wrapped around? or i can pass the event params i get from the api routes? what do you think is better?
7 replies
NNuxt
Created by rosalina saige, cutest kitty :3 on 3/31/2024 in #❓・help
passing components up the tree
titlebar = ref("");

passing like this
v-model:titlebar="titlebar"

in children:
<h1> {{ titlebar }} </h1>
const titlebar = defineModel("titlebar")
titlebar.value = ...
titlebar = ref("");

passing like this
v-model:titlebar="titlebar"

in children:
<h1> {{ titlebar }} </h1>
const titlebar = defineModel("titlebar")
titlebar.value = ...
6 replies
NNuxt
Created by rosalina saige, cutest kitty :3 on 3/31/2024 in #❓・help
passing components up the tree
i think you can defineModels on children then having a ref on parent -> you can change the title by changing on the (defineModels on children). that's how i would do it
6 replies