最适合我的柜台?一个对象或简单对象?

发布于 2025-02-10 03:26:11 字数 582 浏览 2 评论 0原文

我需要跟踪并显示使用价格点多少次,例如:“ 15美元(2个选项)”,鉴于我需要显示价格和计数并增加计数时间以给定价格添加了新的选项,我是否应该使用:

或以下:

”“在此处输入图像说明”

注意:不要注意字段名称“ array”和“ Object-priceCount”,这仅是用于测试目的。<<<<<<<<<<<<<< /em>

I need to keep track of and display how many times a price point is being used, e.g.: "$15 (2 options)" Given that i need to display the price and the count and increment the count each time a new option is added at the given price, should I go with:
enter image description here

or this:

enter image description here

Note: do not pay attention to the field names "array" and "object-priceCount", this is for testing purposes only.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

念三年u 2025-02-17 03:26:11

实际上,我会保留这些计数器的地图,以便您可以更新个人计数器:

updateDoc(docRef, { 'priceCounts.USD15': increment(1));

I'd actually keep a map for these counters, so that you can update an individual counter with:

updateDoc(docRef, { 'priceCounts.USD15': increment(1));
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文