Alexander Kim
Alexander Kim
NNuxt
Created by Alexander Kim on 3/26/2024 in #❓・help
How to correctly use lodash in a nuxt 3 module?
I've tried to import lodash with a few different ways: 1. import debounce from 'lodash/debounce' 2. import { debounce } from 'lodash Both gave me an error, whenever i tried to use that component from my module: The requested module '/_nuxt/node_modules/.pnpm/[email protected]/node_modules/lodash/lodash.js?v=74319f89' does not provide an export named 'default' What's the right way to do that? I'm using module starter repo: https://github.com/nuxt/starter/tree/module
2 replies
NNuxt
Created by Alexander Kim on 3/15/2024 in #❓・help
Nuxt module starter: composables aren't recognized by TS
Using this module starter: https://github.com/nuxt/starter/tree/module
<template>
<a-extract-style>
<a-config-provider :theme="theme">
<slot />
</a-config-provider>
</a-extract-style>
</template>

<script setup lang="ts">
const config = useRuntimeConfig()
const theme = computed(() => {
return {
token: {
...config.public.theme,
},
}
})
</script>
<template>
<a-extract-style>
<a-config-provider :theme="theme">
<slot />
</a-config-provider>
</a-extract-style>
</template>

<script setup lang="ts">
const config = useRuntimeConfig()
const theme = computed(() => {
return {
token: {
...config.public.theme,
},
}
})
</script>
Both useRuntimeConfig & computed not recognized by TS, why?
1 replies
NNuxt
Created by Alexander Kim on 3/13/2024 in #❓・help
nuxt/kit how do i install dependency modules (packages) when enabling my module?
inside defineNuxtModule i'm trying to install @nuxtjs/tailwindcss module, but when i do include this module in my app, it doesn't install it automatically
await installModule('@nuxtjs/tailwindcss', {
exposeConfig: true,
})
await installModule('@nuxtjs/tailwindcss', {
exposeConfig: true,
})
1 replies
NNuxt
Created by Alexander Kim on 3/7/2024 in #❓・help
Can i set tailwind configs when extending layers?
I'm using nuxt-tailwind module with a default theme, can i have different configs when extending this layer?
2 replies
NNuxt
Created by Alexander Kim on 1/15/2023 in #❓・help
How to dynamically set body class?
let isDrawerOpen = $ref(false)

useHead({
bodyAttrs: {
class: isDrawerOpen ? 'overflow-hidden' : 'none',
},
})
let isDrawerOpen = $ref(false)

useHead({
bodyAttrs: {
class: isDrawerOpen ? 'overflow-hidden' : 'none',
},
})
toggling isDrawerOpen has no effect, class "none" added all the time.
24 replies
NNuxt
Created by Alexander Kim on 12/21/2022 in #❓・help
How to pass Nuxt context to a composable function
How to pass Nuxt context to a composable function, so i can use emit within composable function?
1 replies
NNuxt
Created by Alexander Kim on 12/5/2022 in #❓・help
Route rules overriding
routeRules: {
'*": { ssr: false },
'/news/**': { ssr: true },
},
routeRules: {
'*": { ssr: false },
'/news/**': { ssr: true },
},
Would this work?
2 replies