roomle - 如何从参数键中提取值
问题描述
我知道可以从配置器的 iFrame 外部读取参数
const frameColour = params.find(({ key }) => key === "frameColour");
但是否可以在 ADD TO CART 操作中读取参数键 (frameColour) 的值并将其显示在 HTML DIV / Input 中?原因是我有参数键,即我正在构建的货架框架的颜色,我希望能够读取颜色并将其显示到屏幕上,然后我可以将该颜色存储在我的外部数据库中
解决方案
After you've created a new configurator using the embedding API you can use this to get notified about parameter updates:
configurator.extended.callbacks.onUpdateParameters = (parameters) => {
// add your logic here
};
configurator.extended
will give you access to the RoomleConfigurator
instance (https://docs.roomle.com/web/api/classes/roomleconfigurator.html)
推荐阅读
- ajax - 对 webapi 的 Ajax 调用未命中 ajax 响应且未返回结果
- python - 没有回复原始套接字python的ARP请求
- ios - UITableViewCell 中的 UIStackView 中的 UICollectionview
- javascript - 如何为 vim 命令执行 tern?
- neo4j - 如何将查询中的所有节点精确匹配到另一个
- c# - 通过 C# 添加 SQL 参数不起作用,但在存储过程中进行硬编码可以吗?
- angular - 将页面选择设置为 PrimeNG p-table 的最后一页
- css - SCSS 映射值内的逗号(框阴影)
- c# - IEqualityComparer 错误
- php - 在 Laravel 中路由锚标记的最佳方法