javascript - 当我随机路由站点时,输入类型编号中的数据绑定 textInput 未显示该值
问题描述
" itemTotal": 300
" orderableQuantity": 981
" orderableQuantityMessage": ""
" originalPrice": 150
" preOrderableQuantity": undefined
" priceChangedMessage": "This item's price has changed since it was added to your cart. Original price was: $150.00 "
" priceListGroupId": "defaultPriceGroup"
" productData": {olapicConfiguration: "9aebf6a8555dafedea6fff54c1c1b399", listVolumePrice: null, x_sLIMFIT: "Fundamental warmth fashioned for everyday.", x_isReversible: false, merchandisingText: null, …}
" productId": "WJM44500C1"
" productPriceChanged": false
" quantity": 2
" rawTotalPrice": 300
" repositoryId": "ci25005140"
" selectedOptions": (2) [{…}, {…}]
" selectedSkuProperties": []
" serviceAccountId": undefined
" serviceId": undefined
" shippingGroupRelationships": [{…}]
" shopperInput": undefined
" skuProperties": undefined
" stockState": "IN_STOCK"
" stockStatus": true
您好我正在使用 Oracle Commerce Cloud 平台,商品数量的购物车页面我使用输入类型编号,因为我使用数据绑定文本输入来设置输入框的值,问题是输入框不是每次都保持为空但是如果我随机加载并来到购物车页面
下面的 js 显示了每次加载购物车页面时应该显示的默认值。对于调试,我使用文本绑定来检查该值是否设置正确,然后查看我最终是否工作正常,DOM 中的某些东西正在影响它可以有人帮助吗?
quantity: ko.observable(1),
<!-- ko if: $data.itemTotal() > 0 -->
<input data-bind="textInput : quantity,event:{change:$parentContext.$parent.updateQty}" name="quantity" id="quantityPress" type="number" min="1">
<div data-bind = "text : quantity"></div>
<!-- /ko -->
解决方案
推荐阅读
- angular - 我想将上面的内容自动填充到下面的输入字段中
- solidity - 当我使用solidity 0.4.25版本时,我遇到了一个错误
- c# - 从 Json 转换的复杂对象上的 LInq
- r - 如何将第三列与最后一列交换,然后删除R中交换的最后一列
- ruby-on-rails - 为什么设计 sign_in 方法的效果不是立竿见影的?
- jquery - Jquery/css:在操作表格单元格的宽度时失去表格响应能力
- tensorflow - 如何使用张量流服务?
- reactjs - 如何使用 next-routes 处理 % 和 # 字符
- excel - 为中国用户更改 VBA 代码
- ios - 在哪里放置视图控制器相关的枚举