serafina
serafina
NNuxt
Created by serafina on 8/1/2024 in #❓・help
Nuxt 3 entry.css does not include Component styles
I have default layout with <Header /> and <Footer />. Both of them are not lazy and have not scoped styles inside. I need my page displays correctly in case of browser has not JS active. The result: styles of Header are in entry.css in build but styles of Footer not. That is why it looks weird. Question: How can I include styles of Footer in entry.css? Not it is in a separate chunk
2 replies
NNuxt
Created by serafina on 5/23/2024 in #❓・help
useAsyncData + pinia store field
There is such a situation: 1. Component.vue: <script setup> const { localData} = storeToRefs(piniaStore()); await useAsyncData(async () => piniaStore().init()); </script> <template> <div v-if=“localeData?.length”></div> </template> 2. Store: const localData = ref<null | string[]> const getLocalData() = async () => { const { data } = $fetch() (This is where everything comes in and in the project console I can see data, but the value is not set and therefore there is nothing on the page, there is a v-if) localData.value = data; } const init = async () => Promise.all([getLocalData()]) The question is, what is it? Maybe I can read something, I've already reread the docks three times on useAsyncData, but the watch cases there don't suit me, because I set the store field, but it always remains empty.
2 replies