Gal
Explore posts from serversTS18046: $i18n is of type unknown (Nuxt 3.8 => 3.11.2)
IDE is giving me error "TS18046: $i18n is of type unknown " when I use below code inside middleware:
const { $i18n } = useNuxtApp();
const locale = $i18n.locale.value;
on nuxt 3.8 i had no IDE error any idea why?
2 replies
add vue components to dynamically generated html fetched from ES
Hello, I have a project where I will be dynamically fetching html content from elasticsearch, in that html there will be divs:
<div class="products-wrapper" data-skus="sku1;sku2;sku3"> </div>
I then need to fetch all divs that have class "products-wrapper" and fetch all products that have skus inside data-skus from elasticsearch. And then I need to insert component <ProductContainer></> inside that div for each product sku inside data-skus.
My question is how can i get all data-skus without actually parsing the html using "v-html" (i want to fetch products first before parsing the content), and how can I add <ProductContainer></> inside that div so nuxt knows its a component rather than just normal text
1 replies