【发布时间】:2018-05-05 20:15:38
【问题描述】:
我有一个使用以下架构的自定义部分:
{% schema %}
{
"name": "Custom",
"settings": [
{
"type": "textarea",
"id": "custom_text_product",
"label": "Insert name of the product here",
"default": "Product"
},
{
"type": "textarea",
"id": "custom_text_msg",
"label": "Custom text",
"default": "Insert text here"
}
]
}
{% endschema %}
基本上我想要的是从每个文本区域获取文本,通过 Javascript 进行操作,然后将其添加到 DOM。
通过.liquid 我只会做{{ section.settings.id }},但我不知道如何在Javascript 中访问它们。因为它是一个大文本,我也不能将它作为数据属性添加到 DOM。
我尝试关注this,但没有成功。
有人可以帮助我或让我参考有关此的文件吗?
非常感谢!
【问题讨论】:
标签: javascript shopify liquid