uicrooks / shopify-theme-lab

Shopify theme development environment using Liquid, Vue and Tailwind CSS. Built on top of Shopify CLI 🧪
https://uicrooks.github.io/shopify-theme-lab-docs/
MIT License
743 stars 132 forks source link

[Question]: Pass props/data from liquid to vue component #171

Closed nicoagp closed 2 years ago

nicoagp commented 2 years ago

Operating system

Mac

Node.js version

16

Shopify CLI version

2.0

Browsers

Chrome

Version

4 (Current)

Modifications

No response

Details

Question. How can I pass an array of items/products into a vue component ? (I would prefer pass data instead of using slots) For instance:

 <render-items :items="{{ products }}"></render-items>

I came from working with twig and in twig I would use a filter: :items="{{ products | json_encode }}"

What people use to do something similar to that, for example to pass images into a gallery, or other objects/arrays into a vue component ?

Thank you!

Notice

nicoagp commented 2 years ago

Reading this fixed my issue: https://themelab.uicrooks.com/guide/troubleshooting.html