NuxtN
Nuxt2y ago
Gal

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
Was this page helpful?