如何从{%raw%}中传递捕获的值(句柄)以从液体中获得shopify的对象?
我正在使用VUE3和Liquid进行某些Shopify主题开发。在我的情况下,Vue组件有一个值,我想使用此值将Shopify对象在液体文件中获取。
<div v-for="handle in featuredHandlesArray" :key="handle" >
{% capture article_liquid %}
{% raw %}{{ handle }}{% endraw %}
{% endcapture %}
{% assign article_obj = articles[article_liquid] %}
</div>
在这里,我从VUE组件中获得了“特色Handlesarray”,并使用V-For循环。没有问题。如果我在循环中呼应了这些“句柄”值,它将打印我的相关句柄。即使我回声捕获了“ {%endcapture%}”标签下方的“ atration_liquid”变量,它也会打印。但是,当我尝试通过该处理方式从Shopify获取文章对象时,没什么。它的意思是“文章[atraty_liquid]”不起作用。我只想通过传递句柄从shopify获取该文章对象,并将该对象分配到诸如“ aptical_obj”之类的变量中。
如果有人遇到了这种问题,请给我一个支持。或任何建议将不胜感激。谢谢!
I'm using vue3 and liquid for some Shopify theme developments.In my case, there is a value from vue component and I want to use this value to get a shopify object within liquid file.
<div v-for="handle in featuredHandlesArray" :key="handle" >
{% capture article_liquid %}
{% raw %}{{ handle }}{% endraw %}
{% endcapture %}
{% assign article_obj = articles[article_liquid] %}
</div>
Here I'm getting above 'featuredHandlesArray' from vue component and looping with a v-for. There's no issue with it. If I echo these 'handle' value in the loop, it prints my relevant handle. Even when I echo captured 'article_liquid' variable below the '{% endcapture %}' tag, it prints too. But when I try to pass that handle to get the article object from shopify, it's nothing. It means 'articles[article_liquid]' is not working. I just want to get that article object from shopify by passing handle and assign that object into a variable like 'article_obj'.
If anyone experienced this kind of issue, please give me a support. Or any suggestion will be very appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论