Alexzvn™
Alexzvn™
NNuxt
Created by Flo on 3/31/2024 in #❓・help
Nuxt Layer: Composable from layer not found
have you tries import { useK8s } from '~/../k8s/composables/k8s' in someHandler.get.ts
8 replies
NNuxt
Created by rosalina saige, cutest kitty :3 on 3/31/2024 in #❓・help
passing components up the tree
// alternative solution is use inject/provide
// see more at https://vuejs.org/guide/components/provide-inject

/** In layout */
const title = ref('')

provide('setTitle', (value: string) => title.value = value)

/** In any child component wrapped by layout */
const setTitle = inject('setTitle') as (value: string) => void

setTitle('something else')
// alternative solution is use inject/provide
// see more at https://vuejs.org/guide/components/provide-inject

/** In layout */
const title = ref('')

provide('setTitle', (value: string) => title.value = value)

/** In any child component wrapped by layout */
const setTitle = inject('setTitle') as (value: string) => void

setTitle('something else')
6 replies